<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chapter 2 Installing and Upgrading MySQL</title>
<link rel="stylesheet" href="mvl.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets + chunker.py v1.9.2" />
<link rel="start" href="index.html" title="{book-title}" />
<link rel="up" href="" title="" />
<link rel="prev" href="introduction.html" title="Chapter 1 General Information" />
<link rel="next" href="tutorial.html" title="Chapter 3 Tutorial" />
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 2 Installing and Upgrading MySQL</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="introduction.html">Prev</a> </td>
<th width="60%" align="center"></th>
<td width="20%" align="right"> <a accesskey="n" href="tutorial.html">Next</a></td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="installing"></a>Chapter 2 Installing and Upgrading MySQL</h1>

</div>

</div>

</div>
<div class="toc">
<p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="installing.html#general-installation-issues">2.1 General Installation Guidance</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#which-version">2.1.1 Which MySQL Version and Distribution to Install</a></span></dt><dt><span class="section"><a href="installing.html#getting-mysql">2.1.2 How to Get MySQL</a></span></dt><dt><span class="section"><a href="installing.html#verifying-package-integrity">2.1.3 Verifying Package Integrity Using MD5 Checksums or GnuPG</a></span></dt><dt><span class="section"><a href="installing.html#installation-layouts">2.1.4 Installation Layouts</a></span></dt><dt><span class="section"><a href="installing.html#compiler-characteristics">2.1.5 Compiler-Specific Build Characteristics</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#binary-installation">2.2 Installing MySQL on Unix/Linux Using Generic Binaries</a></span></dt><dt><span class="section"><a href="installing.html#windows-installation">2.3 Installing MySQL on Microsoft Windows</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#windows-installation-layout">2.3.1 MySQL Installation Layout on Microsoft Windows</a></span></dt><dt><span class="section"><a href="installing.html#windows-choosing-package">2.3.2 Choosing an Installation Package</a></span></dt><dt><span class="section"><a href="installing.html#mysql-installer">2.3.3 MySQL Installer for Windows</a></span></dt><dt><span class="section"><a href="installing.html#windows-notifier">2.3.4 MySQL Notifier</a></span></dt><dt><span class="section"><a href="installing.html#windows-install-archive">2.3.5 Installing MySQL on Microsoft Windows Using a
<code class="literal">noinstall</code> ZIP Archive</a></span></dt><dt><span class="section"><a href="installing.html#windows-troubleshooting">2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation</a></span></dt><dt><span class="section"><a href="installing.html#windows-postinstallation">2.3.7 Windows Postinstallation Procedures</a></span></dt><dt><span class="section"><a href="installing.html#windows-upgrading">2.3.8 Upgrading MySQL on Windows</a></span></dt><dt><span class="section"><a href="installing.html#deploy-mysql-nonlinux-docker">2.3.9 Deploying MySQL on Windows and Other Non-Linux Platforms</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#osx-installation">2.4 Installing MySQL on macOS</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#osx-installation-notes">2.4.1 General Notes on Installing MySQL on macOS</a></span></dt><dt><span class="section"><a href="installing.html#osx-installation-pkg">2.4.2 Installing MySQL on macOS Using Native Packages</a></span></dt><dt><span class="section"><a href="installing.html#osx-installation-launchd">2.4.3 Installing and Using the MySQL Launch Daemon</a></span></dt><dt><span class="section"><a href="installing.html#osx-installation-prefpane">2.4.4 Installing and Using the MySQL Preference Pane</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#linux-installation">2.5 Installing MySQL on Linux</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#linux-installation-yum-repo">2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-apt-repo">2.5.2 Installing MySQL on Linux Using the MySQL APT Repository</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-sles-repo">2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-rpm">2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-debian">2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-docker">2.5.6 Deploying MySQL on Linux with Docker</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-native">2.5.7 Installing MySQL on Linux from the Native Software Repositories</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-juju">2.5.8 Installing MySQL on Linux with Juju</a></span></dt><dt><span class="section"><a href="installing.html#using-systemd">2.5.9 Managing MySQL Server with systemd</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#uln-installation">2.6 Installing MySQL Using Unbreakable Linux Network (ULN)</a></span></dt><dt><span class="section"><a href="installing.html#solaris-installation">2.7 Installing MySQL on Solaris</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#solaris-installation-pkg">2.7.1 Installing MySQL on Solaris Using a Solaris PKG</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#freebsd-installation">2.8 Installing MySQL on FreeBSD</a></span></dt><dt><span class="section"><a href="installing.html#source-installation">2.9 Installing MySQL from Source</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#source-installation-layout">2.9.1 MySQL Layout for Source Installation</a></span></dt><dt><span class="section"><a href="installing.html#installing-source-distribution">2.9.2 Installing MySQL Using a Standard Source Distribution</a></span></dt><dt><span class="section"><a href="installing.html#installing-development-tree">2.9.3 Installing MySQL Using a Development Source Tree</a></span></dt><dt><span class="section"><a href="installing.html#source-configuration-options">2.9.4 MySQL Source-Configuration Options</a></span></dt><dt><span class="section"><a href="installing.html#compilation-problems">2.9.5 Dealing with Problems Compiling MySQL</a></span></dt><dt><span class="section"><a href="installing.html#source-configuration-third-party">2.9.6 MySQL Configuration and Third-Party Tools</a></span></dt><dt><span class="section"><a href="installing.html#source-installation-doxygen">2.9.7 Generating MySQL Doxygen Documentation Content</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#postinstallation">2.10 Postinstallation Setup and Testing</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#data-directory-initialization">2.10.1 Initializing the Data Directory</a></span></dt><dt><span class="section"><a href="installing.html#starting-server">2.10.2 Starting the Server</a></span></dt><dt><span class="section"><a href="installing.html#testing-server">2.10.3 Testing the Server</a></span></dt><dt><span class="section"><a href="installing.html#default-privileges">2.10.4 Securing the Initial MySQL Account</a></span></dt><dt><span class="section"><a href="installing.html#automatic-start">2.10.5 Starting and Stopping MySQL Automatically</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#upgrading-downgrading">2.11 Upgrading or Downgrading MySQL</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#upgrading">2.11.1 Upgrading MySQL</a></span></dt><dt><span class="section"><a href="installing.html#downgrading">2.11.2 Downgrading MySQL</a></span></dt><dt><span class="section"><a href="installing.html#rebuilding-tables">2.11.3 Rebuilding or Repairing Tables or Indexes</a></span></dt><dt><span class="section"><a href="installing.html#copying-databases">2.11.4 Copying MySQL Databases to Another Machine</a></span></dt></dl></dd><dt><span class="section"><a href="installing.html#perl-support">2.12 Perl Installation Notes</a></span></dt><dd><dl><dt><span class="section"><a href="installing.html#perl-installation">2.12.1 Installing Perl on Unix</a></span></dt><dt><span class="section"><a href="installing.html#activestate-perl">2.12.2 Installing ActiveState Perl on Windows</a></span></dt><dt><span class="section"><a href="installing.html#perl-support-problems">2.12.3 Problems Using the Perl DBI/DBD Interface</a></span></dt></dl></dd></dl>
</div>
<a class="indexterm" name="idm139899660535872"></a><p>
    This chapter describes how to obtain and install MySQL. A summary of
    the procedure follows and later sections provide the details. If you
    plan to upgrade an existing version of MySQL to a newer version
    rather than install MySQL for the first time, see
    <a class="xref" href="installing.html#upgrading" title="2.11.1 Upgrading MySQL">Section 2.11.1, “Upgrading MySQL”</a>, for information about upgrade
    procedures and about issues that you should consider before
    upgrading.
  </p><p>
    If you are interested in migrating to MySQL from another database
    system, see <a class="xref" href="faqs.html#faqs-migration" title="A.8 MySQL 8.0 FAQ: Migration">Section A.8, “MySQL 8.0 FAQ: Migration”</a>, which contains answers
    to some common questions concerning migration issues.
  </p><p>
    Installation of MySQL generally follows the steps outlined here:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
        <span class="bold"><strong>Determine whether MySQL runs and is
        supported on your platform.</strong></span>
      </p><p>
        Please note that not all platforms are equally suitable for
        running MySQL, and that not all platforms on which MySQL is
        known to run are officially supported by Oracle Corporation. For
        information about those platforms that are officially supported,
        see <a class="ulink" href="http://www.mysql.com/support/supportedplatforms/database.html" target="_top">http://www.mysql.com/support/supportedplatforms/database.html</a> on the MySQL
        website.
      </p></li><li class="listitem"><p>
        <span class="bold"><strong>Choose which distribution to
        install.</strong></span>
      </p><p>
        Several versions of MySQL are available, and most are available
        in several distribution formats. You can choose from
        pre-packaged distributions containing binary (precompiled)
        programs or source code. When in doubt, use a binary
        distribution. Oracle also provides access to the MySQL source
        code for those who want to see recent developments and test new
        code. To determine which version and type of distribution you
        should use, see <a class="xref" href="installing.html#which-version" title="2.1.1 Which MySQL Version and Distribution to Install">Section 2.1.1, “Which MySQL Version and Distribution to Install”</a>.
      </p></li><li class="listitem"><p>
        <span class="bold"><strong>Download the distribution that you want to
        install.</strong></span>
      </p><p>
        For instructions, see <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>. To verify
        the integrity of the distribution, use the instructions in
        <a class="xref" href="installing.html#verifying-package-integrity" title="2.1.3 Verifying Package Integrity Using MD5 Checksums or GnuPG">Section 2.1.3, “Verifying Package Integrity Using MD5 Checksums or GnuPG”</a>.
      </p></li><li class="listitem"><p>
        <span class="bold"><strong>Install the distribution.</strong></span>
      </p><p>
        To install MySQL from a binary distribution, use the
        instructions in <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
      </p><p>
        To install MySQL from a source distribution or from the current
        development source tree, use the instructions in
        <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
      </p></li><li class="listitem"><p>
        <span class="bold"><strong>Perform any necessary postinstallation
        setup.</strong></span>
      </p><p>
        After installing MySQL, see <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>
        for information about making sure the MySQL server is working
        properly. Also refer to the information provided in
        <a class="xref" href="installing.html#default-privileges" title="2.10.4 Securing the Initial MySQL Account">Section 2.10.4, “Securing the Initial MySQL Account”</a>. This section describes how
        to secure the initial MySQL <code class="literal">root</code> user
        account, <span class="emphasis"><em>which has no password</em></span> until you
        assign one. The section applies whether you install MySQL using
        a binary or source distribution.
      </p></li><li class="listitem"><p>
        If you want to run the MySQL benchmark scripts, Perl support for
        MySQL must be available. See <a class="xref" href="installing.html#perl-support" title="2.12 Perl Installation Notes">Section 2.12, “Perl Installation Notes”</a>.
</p></li></ol>
</div>
<p>
    Instructions for installing MySQL on different platforms and
    environments is available on a platform by platform basis:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        <span class="bold"><strong>Unix, Linux, FreeBSD</strong></span>
      </p><p>
        For instructions on installing MySQL on most Linux and Unix
        platforms using a generic binary (for example, a
        <code class="filename">.tar.gz</code> package), see
        <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
      </p><p>
        For information on building MySQL entirely from the source code
        distributions or the source code repositories, see
        <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>
      </p><p>
        For specific platform help on installation, configuration, and
        building from source see the corresponding platform section:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
            Linux, including notes on distribution specific methods, see
            <a class="xref" href="installing.html#linux-installation" title="2.5 Installing MySQL on Linux">Section 2.5, “Installing MySQL on Linux”</a>.
          </p></li><li class="listitem"><p>
            Solaris, including PKG and IPS formats, see
            <a class="xref" href="installing.html#solaris-installation" title="2.7 Installing MySQL on Solaris">Section 2.7, “Installing MySQL on Solaris”</a>.
          </p></li><li class="listitem"><p>
            IBM AIX, see <a class="xref" href="installing.html#solaris-installation" title="2.7 Installing MySQL on Solaris">Section 2.7, “Installing MySQL on Solaris”</a>.
          </p></li><li class="listitem"><p>
            FreeBSD, see <a class="xref" href="installing.html#freebsd-installation" title="2.8 Installing MySQL on FreeBSD">Section 2.8, “Installing MySQL on FreeBSD”</a>.
</p></li></ul>
</div>
</li><li class="listitem"><p>
        <span class="bold"><strong>Microsoft Windows</strong></span>
      </p><p>
        For instructions on installing MySQL on Microsoft Windows, using
        either the MySQL Installer or Zipped binary, see
        <a class="xref" href="installing.html#windows-installation" title="2.3 Installing MySQL on Microsoft Windows">Section 2.3, “Installing MySQL on Microsoft Windows”</a>.
      </p><p>
        For information about managing MySQL instances, see
        <a class="xref" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">Section 2.3.4, “MySQL Notifier”</a>.
      </p><p>
        For details and instructions on building MySQL from source code
        using Microsoft Visual Studio, see
        <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
      </p></li><li class="listitem"><p>
        <span class="bold"><strong>OS X</strong></span>
      </p><p>
        For installation on OS X, including using both the binary
        package and native PKG formats, see
        <a class="xref" href="installing.html#osx-installation" title="2.4 Installing MySQL on macOS">Section 2.4, “Installing MySQL on macOS”</a>.
      </p><p>
        For information on making use of an OS X Launch Daemon to
        automatically start and stop MySQL, see
        <a class="xref" href="installing.html#osx-installation-launchd" title="2.4.3 Installing and Using the MySQL Launch Daemon">Section 2.4.3, “Installing and Using the MySQL Launch Daemon”</a>.
      </p><p>
        For information on the MySQL Preference Pane, see
        <a class="xref" href="installing.html#osx-installation-prefpane" title="2.4.4 Installing and Using the MySQL Preference Pane">Section 2.4.4, “Installing and Using the MySQL Preference Pane”</a>.
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="general-installation-issues"></a>2.1 General Installation Guidance</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#which-version">2.1.1 Which MySQL Version and Distribution to Install</a></span></dt><dt><span class="section"><a href="installing.html#getting-mysql">2.1.2 How to Get MySQL</a></span></dt><dt><span class="section"><a href="installing.html#verifying-package-integrity">2.1.3 Verifying Package Integrity Using MD5 Checksums or GnuPG</a></span></dt><dt><span class="section"><a href="installing.html#installation-layouts">2.1.4 Installation Layouts</a></span></dt><dt><span class="section"><a href="installing.html#compiler-characteristics">2.1.5 Compiler-Specific Build Characteristics</a></span></dt></dl>
</div>
<p>
    The immediately following sections contain the information necessary
    to choose, download, and verify your distribution. The instructions
    in later sections of the chapter describe how to install the
    distribution that you choose. For binary distributions, see the
    instructions at <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a> or the
    corresponding section for your platform if available. To build MySQL
    from source, use the instructions in
    <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="which-version"></a>2.1.1 Which MySQL Version and Distribution to Install</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm139899660481872"></a><a class="indexterm" name="idm139899660480416"></a><p>
      MySQL is available on a number of operating systems and platforms.
      For information about those platforms that are officially
      supported, see <a class="ulink" href="http://www.mysql.com/support/supportedplatforms/database.html" target="_top">http://www.mysql.com/support/supportedplatforms/database.html</a> on the
      MySQL website.
    </p><p>
      When preparing to install MySQL, decide which version and
      distribution format (binary or source) to use.
    </p><a class="indexterm" name="idm139899660476224"></a><a class="indexterm" name="idm139899660475136"></a><a class="indexterm" name="idm139899660474048"></a><a class="indexterm" name="idm139899660472976"></a><a class="indexterm" name="idm139899660471488"></a><p>
      First, decide whether to install a development release or a
      General Availability (GA) release. Development releases have the
      newest features, but are not recommended for production use. GA
      releases, also called production or stable releases, are meant for
      production use. We recommend using the most recent GA release.
    </p><a class="indexterm" name="idm139899660469248"></a><a class="indexterm" name="idm139899660467760"></a><a class="indexterm" name="idm139899660466272"></a><a class="indexterm" name="idm139899660464768"></a><a class="indexterm" name="idm139899660463312"></a><a class="indexterm" name="idm139899660461856"></a><a class="indexterm" name="idm139899660460400"></a><a class="indexterm" name="idm139899660458944"></a><p>
      The naming scheme in MySQL 8.0 uses release names
      that consist of three numbers and an optional suffix; for example,
      <span class="bold"><strong>mysql-8.0.1-dmr</strong></span>. The numbers
      within the release name are interpreted as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The first number (<span class="bold"><strong>8</strong></span>) is the
          major version number.
        </p></li><li class="listitem"><p>
          The second number (<span class="bold"><strong>0</strong></span>) is the
          minor version number. Taken together, the major and minor
          numbers constitute the release series number. The series
          number describes the stable feature set.
        </p></li><li class="listitem"><p>
          The third number (<span class="bold"><strong>1</strong></span>) is the
          version number within the release series. This is incremented
          for each new bugfix release. In most cases, the most recent
          version within a series is the best choice.
</p></li></ul>
</div>
<p>
      Release names can also include a suffix to indicate the stability
      level of the release. Releases within a series progress through a
      set of suffixes to indicate how the stability level improves. The
      possible suffixes are:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <span class="bold"><strong>dmr</strong></span> indicates a development
          milestone release (DMR). MySQL development uses a milestone
          model, in which each milestone introduces a small subset of
          thoroughly tested features. From one milestone to the next,
          feature interfaces may change or features may even be removed,
          based on feedback provided by community members who try these
          earily releases. Features within milestone releases may be
          considered to be of pre-production quality.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>rc</strong></span> indicates a Release
          Candidate (RC). Release candidates are believed to be stable,
          having passed all of MySQL's internal testing. New features
          may still be introduced in RC releases, but the focus shifts
          to fixing bugs to stabilize features introduced earlier within
          the series.
        </p></li><li class="listitem"><p>
          Absence of a suffix indicates a General Availability (GA) or
          Production release. GA releases are stable, having
          successfully passed through the earlier release stages, and
          are believed to be reliable, free of serious bugs, and
          suitable for use in production systems.
</p></li></ul>
</div>
<p>
      Development within a series begins with DMR releases, followed by
      RC releases, and finally reaches GA status releases.
    </p><p>
      After choosing which MySQL version to install, decide which
      distribution format to install for your operating system. For most
      use cases, a binary distribution is the right choice. Binary
      distributions are available in native format for many platforms,
      such as RPM packages for Linux or DMG packages for OS X.
      Distributions are also available in more generic formats such as
      Zip archives or compressed <span class="command"><strong>tar</strong></span> files. On
      Windows, you can use <a class="link" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">the MySQL
      Installer</a> to install a binary distribution.
    </p><p>
      Under some circumstances, it may be preferable to install MySQL
      from a source distribution:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          You want to install MySQL at some explicit location. The
          standard binary distributions are ready to run at any
          installation location, but you might require even more
          flexibility to place MySQL components where you want.
        </p></li><li class="listitem"><p>
          You want to configure <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with features
          that might not be included in the standard binary
          distributions. Here is a list of the most common extra options
          used to ensure feature availability:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <a class="link" href="installing.html#option_cmake_with_libwrap"><code class="option">-DWITH_LIBWRAP=1</code></a> for TCP
              wrappers support.
            </p></li><li class="listitem"><p>
              <a class="link" href="installing.html#option_cmake_with_zlib"><code class="option">-DWITH_ZLIB={system|bundled}</code></a>
              for features that depend on compression
            </p></li><li class="listitem"><p>
              <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">-DWITH_DEBUG=1</code></a> for debugging
              support
</p></li></ul>
</div>
<p>
          For additional information, see
          <a class="xref" href="installing.html#source-configuration-options" title="2.9.4 MySQL Source-Configuration Options">Section 2.9.4, “MySQL Source-Configuration Options”</a>.
        </p></li><li class="listitem"><p>
          You want to configure <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> without some
          features that are included in the standard binary
          distributions.
        </p></li><li class="listitem"><p>
          You want to read or modify the C and C++ code that makes up
          MySQL. For this purpose, obtain a source distribution.
        </p></li><li class="listitem"><p>
          Source distributions contain more tests and examples than
          binary distributions.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="getting-mysql"></a>2.1.2 How to Get MySQL</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899660424624"></a><a class="indexterm" name="idm139899660423552"></a><a class="indexterm" name="idm139899660422480"></a><a class="indexterm" name="idm139899660420992"></a><a class="indexterm" name="idm139899660419920"></a><a class="indexterm" name="idm139899660418848"></a><p>
      Check our downloads page at <a class="ulink" href="http://dev.mysql.com/downloads/" target="_top">http://dev.mysql.com/downloads/</a>
      for information about the current version of MySQL and for
      downloading instructions. For a complete up-to-date list of MySQL
      download mirror sites, see
      <a class="ulink" href="http://dev.mysql.com/downloads/mirrors.html" target="_top">http://dev.mysql.com/downloads/mirrors.html</a>. You can also find
      information there about becoming a MySQL mirror site and how to
      report a bad or out-of-date mirror.
    </p><p>
      For RPM-based Linux platforms that use Yum as their package
      management system, MySQL can be installed using the
      <a class="ulink" href="http://dev.mysql.com/downloads/repo/yum/" target="_top">MySQL Yum
      Repository</a>. See
      <a class="xref" href="installing.html#linux-installation-yum-repo" title="2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository">Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”</a> for details.
    </p><p>
      For Debian-based Linux platforms, MySQL can be installed using the
      <a class="ulink" href="http://dev.mysql.com/downloads/repo/apt/" target="_top">MySQL APT
      Repository</a>. See
      <a class="xref" href="installing.html#linux-installation-apt-repo" title="2.5.2 Installing MySQL on Linux Using the MySQL APT Repository">Section 2.5.2, “Installing MySQL on Linux Using the MySQL APT Repository”</a> for details.
    </p><p>
      For SUSE Linux Enterprise Server (SLES) platforms, MySQL can be
      installed using the
      <a class="ulink" href="http://dev.mysql.com/downloads/repo/suse/" target="_top">MySQL SLES
      Repository</a>. See
      <a class="xref" href="installing.html#linux-installation-sles-repo" title="2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository">Section 2.5.3, “Installing MySQL on Linux Using the MySQL SLES Repository”</a> for details.
    </p><p>
      To obtain the latest development source, see
      <a class="xref" href="installing.html#installing-development-tree" title="2.9.3 Installing MySQL Using a Development Source Tree">Section 2.9.3, “Installing MySQL Using a Development Source Tree”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="verifying-package-integrity"></a>2.1.3 Verifying Package Integrity Using MD5 Checksums or GnuPG</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#verifying-md5-checksum">2.1.3.1 Verifying the MD5 Checksum</a></span></dt><dt><span class="section"><a href="installing.html#checking-gpg-signature">2.1.3.2 Signature Checking Using GnuPG</a></span></dt><dt><span class="section"><a href="installing.html#checking-gpg-signature-windows">2.1.3.3 Signature Checking Using Gpg4win for Windows</a></span></dt><dt><span class="section"><a href="installing.html#checking-rpm-signature">2.1.3.4 Signature Checking Using RPM</a></span></dt></dl>
</div>
<p>
      After downloading the MySQL package that suits your needs and
      before attempting to install it, make sure that it is intact and
      has not been tampered with. There are three means of integrity
      checking:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          MD5 checksums
        </p></li><li class="listitem"><p>
          Cryptographic signatures using <code class="literal">GnuPG</code>, the
          GNU Privacy Guard
        </p></li><li class="listitem"><p>
          For RPM packages, the built-in RPM integrity verification
          mechanism
</p></li></ul>
</div>
<p>
      The following sections describe how to use these methods.
    </p><p>
      If you notice that the MD5 checksum or GPG signatures do not
      match, first try to download the respective package one more time,
      perhaps from another mirror site.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="verifying-md5-checksum"></a>2.1.3.1 Verifying the MD5 Checksum</h4>
</div>
</div>
</div>
<p>
        After you have downloaded a MySQL package, you should make sure
        that its MD5 checksum matches the one provided on the MySQL
        download pages. Each package has an individual checksum that you
        can verify against the package that you downloaded. The correct
        MD5 checksum is listed on the downloads page for each MySQL
        product, and you will compare it against the MD5 checksum of the
        file (product) that you download.
      </p><p>
        Each operating system and setup offers its own version of tools
        for checking the MD5 checksum. Typically the command is named
        <span class="command"><strong>md5sum</strong></span>, or it may be named
        <span class="command"><strong>md5</strong></span>, and some operating systems do not ship
        it at all. On Linux, it is part of the <span class="bold"><strong>GNU
        Text Utilities</strong></span> package, which is available for a wide
        range of platforms. You can also download the source code from
        <a class="ulink" href="http://www.gnu.org/software/textutils/" target="_top">http://www.gnu.org/software/textutils/</a>. If you
        have OpenSSL installed, you can use the command <span class="command"><strong>openssl
        md5 <em class="replaceable"><code>package_name</code></em></strong></span> instead. A
        Windows implementation of the <span class="command"><strong>md5</strong></span> command
        line utility is available from
        <a class="ulink" href="http://www.fourmilab.ch/md5/" target="_top">http://www.fourmilab.ch/md5/</a>.
        <span class="command"><strong>winMd5Sum</strong></span> is a graphical MD5 checking tool
        that can be obtained from
        <a class="ulink" href="http://www.nullriver.com/index/products/winmd5sum" target="_top">http://www.nullriver.com/index/products/winmd5sum</a>.
        Our Microsoft Windows examples will assume the name
        <span class="command"><strong>md5.exe</strong></span>.
      </p><p>
        Linux and Microsoft Windows examples:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>md5sum mysql-standard-8.0.13-linux-i686.tar.gz</code></strong>
aaab65abbec64d5e907dcd41b8699945  mysql-standard-8.0.13-linux-i686.tar.gz
</pre><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>md5.exe mysql-installer-community-8.0.13.msi</code></strong>
aaab65abbec64d5e907dcd41b8699945  mysql-installer-community-8.0.13.msi
</pre><p>
        You should verify that the resulting checksum (the string of
        hexadecimal digits) matches the one displayed on the download
        page immediately below the respective package.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Make sure to verify the checksum of the <span class="emphasis"><em>archive
          file</em></span> (for example, the <code class="filename">.zip</code>,
          <code class="filename">.tar.gz</code>, or <code class="filename">.msi</code>
          file) and not of the files that are contained inside of the
          archive. In other words, verify the file before extracting its
          contents.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="checking-gpg-signature"></a>2.1.3.2 Signature Checking Using GnuPG</h4>

</div>

</div>

</div>
<p>
        Another method of verifying the integrity and authenticity of a
        package is to use cryptographic signatures. This is more
        reliable than using <a class="link" href="installing.html#verifying-md5-checksum" title="2.1.3.1 Verifying the MD5 Checksum">MD5
        checksums</a>, but requires more work.
      </p><p>
        We sign MySQL downloadable packages with
        <span class="command"><strong>GnuPG</strong></span> (GNU Privacy Guard).
        <span class="command"><strong>GnuPG</strong></span> is an Open Source alternative to the
        well-known Pretty Good Privacy (<span class="command"><strong>PGP</strong></span>) by Phil
        Zimmermann. Most Linux distributions ship with
        <span class="command"><strong>GnuPG</strong></span> installed by default. Otherwise, see
        <a class="ulink" href="http://www.gnupg.org/" target="_top">http://www.gnupg.org/</a> for more information about
        <span class="command"><strong>GnuPG</strong></span> and how to obtain and install it.
      </p><p>
        To verify the signature for a specific package, you first need
        to obtain a copy of our public GPG build key, which you can
        download from <a class="ulink" href="http://pgp.mit.edu/" target="_top">http://pgp.mit.edu/</a>. The key that
        you want to obtain is named
        <code class="literal">mysql-build@oss.oracle.com</code>. Alternatively,
        you can copy and paste the key directly from the following text:
      </p><pre data-lang="none" class="programlisting">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)

mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3
RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ
fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3
BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW
hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV
K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE
kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI
QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep
rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q2TXlTUUwgUmVs
ZWFzZSBFbmdpbmVlcmluZyA8bXlzcWwtYnVpbGRAb3NzLm9yYWNsZS5jb20+iGwE
ExECACwCGyMCHgECF4ACGQEGCwkIBwMCBhUKCQgCAwUWAgMBAAUCWKcFIAUJHirJ
FAAKCRCMcY07UHLh9VcFAJ46pUyVd8BZ2r5CppMC1tmyQ3ceRgCfVPwuVsiS0VER
5WUqtAQDt+DoetCIaQQTEQIAKQIbIwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAhkB
BQJTAdRmBQkaZsvLAAoJEIxxjTtQcuH1X4MAoKNLWAbCBUj96637kv6Xa/fJuX5m
AJwPtmgDfjUe2iuhXdTrFEPT19SB6ohmBBMRAgAmAhsjBgsJCAcDAgQVAggDBBYC
AwECHgECF4AFAk53PioFCRP7AhUACgkQjHGNO1By4fUmzACeJdfqgc9gWTUhgmcM
AOmG4RjwuxcAoKfM+U8yMOGELi+TRif7MtKEms6piGkEExECACkCGyMGCwkIBwMC
BBUCCAMEFgIDAQIeAQIXgAIZAQUCUZSROgUJFTchqgAKCRCMcY07UHLh9YtAAJ9X
rA/ymlmozPZn+A9ls8/uwMcTsQCfaQMNq1dNkhH2kyByc3Rx9/W2xfqJARwEEAEC
AAYFAlAS6+UACgkQ8aIC+GoXHivrWwf/dtLk/x+NC2VMDlg+vOeM0qgG1IlhXZfi
NsEisvvGaz4m8fSFRGe+1bvvfDoKRhxiGXU48RusjixzvBb6KTMuY6JpOVfz9Dj3
H9spYriHa+i6rYySXZIpOhfLiMnTy7NH2OvYCyNzSS/ciIUACIfH/2NH8zNT5CNF
1uPNRs7HsHzzz7pOlTjtTWiF4cq/Ij6Z6CNrmdj+SiMvjYN9u6sdEKGtoNtpycgD
5HGKR+I7Nd/7v56yhaUe4FpuvsNXig86K9tI6MUFS8CUyy7Hj3kVBZOUWVBM053k
nGdALSygQr50DA3jMGKVl4ZnHje2RVWRmFTr5YWoRTMxUSQPMLpBNIkBHAQQAQIA
BgUCU1B+vQAKCRAohbcD0zcc8dWwCACWXXWDXIcAWRUw+j3ph8dr9u3SItljn3wB
c7clpclKWPuLvTz7lGgzlVB0s8hH4xgkSA+zLzl6u56mpUzskFl7f1I3Ac9GGpM4
0M5vmmR9hwlD1HdZtGfbD+wkjlqgitNLoRcGdRf/+U7x09GhSS7Bf339sunIX6sM
gXSC4L32D3zDjF5icGdb0kj+3lCrRmp853dGyA3ff9yUiBkxcKNawpi7Vz3D2ddU
pOF3BP+8NKPg4P2+srKgkFbd4HidcISQCt3rY4vaTkEkLKg0nNA6U4r0YgOa7wIT
SsxFlntMMzaRg53QtK0+YkH0KuZR3GY8B7pi+tlgycyVR7mIFo7riQEcBBABCAAG
BQJWgVd0AAoJEEZu4b/gk4UKk9MH/Rnt7EccPjSJC5CrB2AU5LY2Dsr+PePI2ubP
WsEdG82qSjjGpbhIH8LSg/PzQoGHiFWMmmZWJktRT+dcgLbs3b2VwCNAwCE8jOHd
UkQhEowgomdNvHiBHKHjP4/lF68KOPiO/2mxYYkmpM7BWf3kB57DJ5CTi3/JLoN7
zF40qIs/p09ePvnwStpglbbtUn7XPO+1/Ee8VHzimABom52PkQIuxNiVUzLVn3bS
Wqrd5ecuqLk6yzjPXd2XhDHWC9Twpl68GePru6EzQtusi0m6S/sHgEXqh/IxrFZV
JlljF75JvosZq5zeulr0i6kOij+Y1p6MFffihITZ1gTmk+CLvK2JASIEEAECAAwF
Ak53QS4FAwASdQAACgkQlxC4m8pXrXwJ8Qf/be/UO9mqfoc2sMyhwMpN4/fdBWwf
LkA12FXQDOQMvwH9HsmEjnfUgYKXschZRi+DuHXe1P7l8G2aQLubhBsQf9ejKvRF
TzuWMQkdIq+6Koulxv6ofkCcv3d1xtO2W7nb5yxcpVBPrRfGFGebJvZa58DymCNg
yGtAU6AOz4veavNmI2+GIDQsY66+tYDvZ+CxwzdYu+HDV9HmrJfc6deM0mnBn7SR
jqzxJPgoTQhihTav6q/R5/2p5NvQ/H84OgS6GjosfGc2duUDzCP/kheMRKfzuyKC
OHQPtJuIj8++gfpHtEU7IDUX1So3c9n0PdpeBvclsDbpRnCNxQWU4mBot4kBIgQQ
AQIADAUCToi2GQUDABJ1AAAKCRCXELibyletfLZAB/9oRqx+NC98UQD/wlxCRytz
vi/MuPnbgQUPLHEap10tvEi33S/H/xDR/tcGofY4cjAvo5skZXXeWq93Av7PACUb
zkg0X0eSr2oL6wy66xfov72AwSuX+iUK68qtKaLqRLitM02y8aNRV/ggKvt7UMvG
mOvs5yLaYlobyvGaFC2ClfkNOt2MlVnQZCmnYBCwOktPGkExiu2yZMifcYGxQcpH
KVFG59KeF2cM2d4xYM8HJqkSGGW306LFVSyeRwG+wbttgLpD5bM/T2b3fF/J35ra
CSMLZearRTq8aygPl+XM7MM2eR946aw6jmOsgNBErbvvIdQj6LudAZj+8imcXV2K
iQEiBBABAgAMBQJOmdnRBQMAEnUAAAoJEJcQuJvKV618AvIIAIEF1ZJ+Ry7WOdKF
5oeQ/ynaYUigzN92fW/9zB8yuQlngkFJGidYMbci1tR1siziIVJFusR3ZonqAPGK
/SUta9Y6KWLhmc7c5UnEHklq/NfdMZ2WVSIykXlctqw0sbb+z1ecEd4G8u9j5ill
MO1B36rQayYAPoeXLX8dY4VyFLVGaQ00rWQBYFZrpw16ATWbWGJP332NSfCk4zZq
6kXEW07q0st3YBgAAGdNQyEeZCa4d4pBRSX6189Kjg6GDnIcaiOF6HO6PLr9fRlL
r5ObCgU+G9gEhfiVwDEV9E+7/Bq2pYZ9whhkBqWQzdpXTNTM24uaEhE01EPO5zeC
O214q6mJASIEEAECAAwFAk6rpgEFAwASdQAACgkQlxC4m8pXrXzAhwf/f9O99z16
3Y5FZVIxexyqXQ/Mct9uKHuXEVnRFYbA49dQLD4S73N+zN7gn9jFeQcBo4w8qVUV
94U/ta/VbLkdtNREyplPM4XY8YE5Wfd9bfyg3q1PbEiVjk995sBF+2+To99YYKst
gXPqjlH0jUfEyDmexOj+hsp8Rc63kvkIx36VBa4ONRYFefGAhKDMigL2YAhc1UkG
tkGTuLmlCGwIV6lviDZD3RJf5375VFnaHv7eXfwQxCwE+BxG3CURrjfxjaxMTmMP
yAG2rhDp5oTUEvqDYNbko5UxYOmrSjvF4FzXwqerElXJUkUzSh0pp7RxHB/1lCxD
s7D1F1hlgFQuNIkBIgQQAQIADAUCTrzZHAUDABJ1AAAKCRCXELibyletfMUpB/4s
07dREULIBnA1D6qr3fHsQJNZqbAuyDlvgGGLWzoyEDs+1JMFFlaa+EeLIo1386GU
2DammDC23p3IB79uQhJeD2Z1TcVg4cA64SfF/CHca5coeRSrdAiudzU/cgLGtXIP
/OaFamXgdMxAhloLFbSHPCZkyb00phVa8+xeIVDrK1HByZsNIXy/SSK8U26S2PVZ
2o14fWvKbJ1Aga8N6DuWY/D8P2mi3RAbiuZgfzkmKL5idH/wSKfnFKdTgJzssdCc
1jZEGVk5rFYcWOrJARHeP/tsnb/UxKBEsNtO7e3N2e/rLVnEykVIO066hz7xZK/V
NBSpx3k3qj4XPK41IHy2iQEiBBABAgAMBQJOzqO8BQMAEnUAAAoJEJcQuJvKV618
2twH/0IzjXLxN45nvIfEjC75a+i9ZSLlqR8lsHL4GpEScFKI0a0lT4IVAIY2RKG+
MAs2eHm0UfKuwGs5jluRZ9RqKrc61sY0XQV9/7znY9Db16ghX04JjknOKs/fPi87
rvKkB/QxJWS8qbb/erRmW+cPNjbRxTFPS5JIwFWHA16ieFEpvdAgKV6nfvJVTq1r
jPDcnIA9CJN2SmUFx9Qx3SRc6ITbam1hjFnY6sCh6AUhxLI2f1mq1xH9PqEy42Um
68prRqTyJ7Iox1g/UDDkeeUcAg7T1viTz7uXpS3Wrq4zzo4yOpaJfLDR3pI5g2Zk
SNGTMo6aySE4OABt8i1Pc1Pm6AmJASIEEAECAAwFAk7yPFYFAwASdQAACgkQlxC4
m8pXrXzXiAf9FrXe0lgcPM+tYOWMLhv5gXJi2VUBaLxpyRXm/kJcmxInKq1GCd3y
D4/FLHNu3ZcCz/uklPAbZXWI0O6ewq0LWsRtklmJjWiedH+hGyaTv95VklojRIBd
8nBaJ6M98rljMBHTFwWvjQFVf4FLRJQZqHlvjcCkq2Dd9BWJpGXvr/gpKkmMJYNK
/ftfZRcChb35NI19WRpOhj9u808OPcqKVvZBcPwFGV5cEBzmAC94J7JcD8+S8Ik8
iUJMQGGL3QcmZOBozovh86hj7KTSEBHlLXl832z89H1hLeuLbnXoGLv3zeUFSxkv
1h35LhZLqIMDQRXLuUzxGHMBpLhPyGWRJ4kBIgQQAQIADAUCTwQJFwUDABJ1AAAK
CRCXELibyletfABvB/9Cy69cjOqLGywITs3Cpg//40jmdhSAVxilJivP6J5bubFH
DJlVTx541Dv5h4hTG2BQuueQ4q1VCpSGW+rHcdhPyvmZGRz1rxdQQGh1Dv0Bod2c
3PJVSYPSrRSwCZJkJHOtVRBdjK4mkZb5aFTza+Tor9kxzj4FcXVd4KAS+hHQHYHc
Ar8tt2eOLzqdEFTULeGiSoNn+PVzvzdfhndphK+8F2jfQ2UKuc01O7k0Yn9xZVx0
OG6fE1gStzLv7C5amWLRd8+xh+MN0G8MgNglpBoExsEMMlPBYSUHa6lxpdMNMuib
rIyVncE9X8QOhImt8K0sNn/EdbuldJNGYbDLt7O4iQEiBBABAgAMBQJPFdTcBQMA
EnUAAAoJEJcQuJvKV6184owH+wZ/uLpezXnSxigeH1sig72QEXMrNd5DVHCJdig3
bo+K5YmmN710/m5z+63XKUEWpd6/knajObgckThzWftNeK1SSFQGPmoYZP9EZnSU
7L+/dSUpExbj842G5LYagrCyMGtlxRywWEmbi72TKS/JOK0jLiOdvVy+PHrZSu0D
TVQ7cJh1BmPsbz7zzxjmcI5l+7B7K7RHZHq45nDLoIabwDacj7BXvBK0Ajqz4QyJ
GQUjXC7q+88I+ptPvOXlE5nI/NbiCJOMI6d/bWN1KwYrC80fZuFaznfQFcPyUaDw
yRaun+K3kEji2wXecq+yMmLUEp01TKsUeOL50HD6hHH07W+JASIEEAECAAwFAk85
bQsFAwASdQAACgkQlxC4m8pXrXwKPQgAlkbUsTr7nkq+haOk0jKpaHWEbRMEGMrB
I3F7E+RDO6V/8y4Jtn04EYDc8GgZMBah+mOgeINq3y8jRMYV5jVtZXv2MWYFUcjM
kVBKeqhi/pGEjmUdmdt3DlPv3Z+fMTMRmAocI981iY/go8PVPg/+nrR6cFK2xxnO
R8TacikJBFeSfkkORg1tDzjjYv1B5ZIEkpplepl5ahJBBq7cpYhTdY6Yk0Sz0J8w
EdffLSaNxrRuWLrRhWzZU7p9bFzfb/7OHc21dJnB7wKv5VvtgE+jiQw9tOKaf5hc
SgRYuF6heu+B25gc5Uu88lo409mZ7oxQ6hDCn7JHvzh0rhmSN+Kid4kBIgQQAQIA
DAUCT0qQrQUDABJ1AAAKCRCXELibyletfC9UB/4o2ggJYM0CLxEpP0GU8UKOh3+/
zm1DN7Qe4kY2iCtF1plKHQaTgt5FlgRCFaiXcVv7WzGz/FnmxonR1leLl+kfRlwy
PPnoI/AWPCy/NO4Cl5KnjsSmsdDUpObwZ4KYsdilZR7ViJu2swdAIgnXBUwrlRJR
7CK4TAKrTeonRgVSrVx8Vt//8/cYj73CLq8oY/KK0iHiQrSwo44uyhdiFIAssjyX
n6/2E+w0zgvPexNSNNROHQ8pjbq+NTY6GwKIGsaej3UTRwQ7psvKXz8y7xdzmOAr
/khGvxB5gjkx02pimjeia8v66aH6rbnojJMAovNUS4EHdHnulv4rovC8Kf9iiQEi
BBABAgAMBQJPVdsaBQMAEnUAAAoJEJcQuJvKV618vVEIALFXPBzcAO1SnQarBLzy
YMVZZumPvSXKnUHAO+6kjApXPJ+qFRdUaSNshZxVKY9Zryblu4ol/fLUTt0CliSD
IxD6L4GXEm4VYYCl4lPO3bVsJnGITLFwQGHM27EmjVoTiD8Ch7kPq2EXr3dMRgzj
pdz+6aHGSUfOdLTPXufDvW83bEWGaRVuTJKw+wIrcuRqQ+ucWJgJGwcE4zeHjZad
Jx1XUm1X+BbI73uiQussyjhhQVVNU7QEdrjyuscaZ/H38wjUwNbylxDPB4I8quC1
knQ0wSHr7gKpM+E9nhiS14poRqU18u78/sJ2MUPXnQA6533IC238/LP8JgqB+BiQ
BTSJASIEEAECAAwFAk9ng3cFAwASdQAACgkQlxC4m8pXrXxQRAf/UZlkkpFJj1om
9hIRz7gS+l7YvTaKSzpo+TBcx3C7aqKJpir6TlMK9cb9HGTHo2Xp1N3FtQL72NvO
6CcJpBURbvSyb4i0hrm/YcbUC4Y3eajWhkRS3iVfGNFbc/rHthViz0r6Y5lhXX16
aVkDv5CIFWaF3BiUK0FnHrZiy4FPacUXCwEjv3uf8MpxV5oEmo8Vs1h4TL3obyUz
qrImFrEMYE/12lkE8iR5KWCaF8eFyl56HL3PPl90JMQBXzhwsFoWCPuwjfM5w6sW
Ll//zynwxtlJ9CRz9c2vK6aJ8DRu3OfBKN1iiEcNEynksDnNXErn5xXKz3p5pYdq
e9BLzUQCDYkBIgQQAQIADAUCT3inRgUDABJ1AAAKCRCXELibyletfGMKCADJ97qk
geBntQ+tZtKSFyXznAugYQmbzJld8U6eGSQnQkM40Vd62UZLdA8MjlWKS8y4A4L2
0cI14zs5tKG9Q72BxQOw5xkxlLASw1/8WeYEbw7ZA+sPG//q9v3kIkru3sv64mMA
enZtxsykexRGyCumxLjzlAcL1drWJGUYE2Kl6uzQS7jb+3PNBloQvz6nb3YRZ+Cg
Ly9D41SIK+fpnV8r4iqhu7r4LmAQ7Q1DF9aoGaYvn2+xLGyWHxJAUet4xkMNOLp6
k9RF1nbNe4I/sqeCB25CZhCTEvHdjSGTD2yJR5jfoWkwO9w8DZG1Q9WrWqki4hSB
l0cmcvO34pC1SJYziQEiBBABAgAMBQJPinQFBQMAEnUAAAoJEJcQuJvKV618CFEI
AJp5BbcV7+JBMRSvkoUcAWDoJSP2ug9zGw5FB8J90PDefKWCKs5Tjayf2TvM5ntq
5DE9SGaXbloIwa74FoZlgqlhMZ4AtY9Br+oyPJ5S844wpAmWMFc6NnEPFaHQkQ+b
dJYpRVNd9lzagJP261P3S+S9T2UeHVdOJBgWIq9Mbs4lnZzWsnZfQ4Lsz0aPqe48
tkU8hw+nflby994qIwNOlk/u+I/lJbNz5zDY91oscXTRl2jV1qBgKYwwCXxyB3j9
fyVpRl+7QnqbTWcCICVFL+uuYpP0HjdoKNqhzEguAUQQLOB9msPTXfa2hG+32ZYg
5pzI5V7GCHq0KO6u5Ctj3TGJASIEEAECAAwFAk+cQEEFAwASdQAACgkQlxC4m8pX
rXzi7AgAx8wJzNdD7UlgdKmrAK//YqH7arSssb33Xf45sVHDpUVA454DXeBrZpi+
zEuo03o5BhAuf38cwfbkV6jN1mC2N0FZfpy4v7RxHKLYr7tr6r+DRn1L1giX5ybx
CgY0fLAxkwscWUKGKABWxkz9b/beEXaO2rMt+7DBUdpAOP5FNRQ8WLRWBcMGQiaT
S4YcNDAiNkrSP8CMLQP+04hQjahxwCgBnksylciqz3Y5/MreybNnTOrdjVDsF0Oe
t0uLOiWXUZV1FfaGIdb/oBQLg+e1B74p5+q3aF8YI97qAZpPa1qiQzWIDX8LX9QX
EFyZ3mvqzGrxkFoocXleNPgWT8fRuokBIgQQAQIADAUCT64N/QUDABJ1AAAKCRCX
ELibyletfDOGCACKfcjQlSxrWlEUrYYZpoBP7DE+YdlIGumt5l6vBmxmt/5OEhqr
+dWwuoiyC5tm9CvJbuZup8anWfFzTTJmPRPsmE4z7Ek+3CNMVM2wIynsLOt1pRFK
4/5RNjRLbwI6EtoCQfpLcZJ//SB56sK4DoFKH28Ok4cplESPnoMqA3QafdSEA/FL
qvZV/iPgtTz7vjQkMgrXAIUM4fvKe3iXkAExGXtmgdXHVFoKmHrxJ2DTSvM7/19z
jGJeu2MhIKHyqEmCk6hLjxyCE5pAH59KlbAQOP1bS28xlRskBApm2wN+LOZWzC62
HhEReQ50inCGuuubK0PqUQnyYc+lUFxrFpcliQEiBBABAgAMBQJPv9lVBQMAEnUA
AAoJEJcQuJvKV618AzgH/iRFFCi4qjvoqji1fi7yNPZVOMMO2H13Ks+AfcjRtHuV
aa30u50ND7TH+XQe6yerTapLh3aAm/sNP99aTxIuwRSlyKEoDs93+XVSgRqPBgbF
/vxv0ykok3p6L9DxFO/w5cL8JrBhMZoJrEkIBFkwN8tWlcXPRFQvcdBYv3M3DTZU
qY+UHnOxHvSzsl+LJ0S9Xcd9C5bvYfabmYJvG5eRS3pj1L/y3a6yw6hvY+JtnQAk
t05TdeHMIgQH/zb8V9wxDzmE0un8LyoC2Jx5TpikQsJSejwK6b3coxVBlngku6+C
qDAimObZLw6H9xYYIK0FoJs7j5bQZEwUO7OLBgjcMOqJASIEEAECAAwFAk/Rpc8F
AwASdQAACgkQlxC4m8pXrXw49Qf/TdNbun2htQ+cRWarszOx8BLEiW/x6PVyUQpZ
nV/0qvhKzlJUjM9hQPcA0AsOjhqtCN6Cy8KXbK/TvPm9D/Nk6HWwD1PomzrJVFk2
ywGFIuTR+lluKSp7mzm5ym0wJs5cPq731Im31RUQU8ndjLrq9YOf5FVL8NqmcOAU
4E8d68BbmVCQC5MMr0901FKwKznShfpy7VYN25/BASj8dhnynBYQErqToOJB6Cnd
JhdTlbfR4SirqAYZZg3XeqGhByytEHE1x7FMWWFYhdNtsnAVhYBbWqAzBs8lF9Jd
Mhaf0VQU/4z10gVrRtXLR/ixrCi+P4cM/fOQkqd6pwqWkaXt6okBIgQQAQIADAUC
T+NxIAUDABJ1AAAKCRCXELibyletfFBBCAC6+0TUJDcNaqOxOG1KViY6KYg9NCL8
pwNK+RKNK/N1V+WGJQH7qDMwRoOn3yogrHax4xIeOWiILrvHK0O6drS1DjsymIhR
Sm2XbE/8pYmEbuJ9vHh3b/FTChmSAO7dDjSKdWD3dvaY8lSsuDDqPdTX8FzOfrXC
M22C/YPg7oUG2A5svE1b+yismP4KmVNWAepEuPZcnEMPFgop3haHg9X2+mj/btDB
Yr6p9kAgIY17nigtNTNjtI0dMLu43aIzedCYHqOlNHiB049jkJs54fMGBjF9qPtc
m0k44xyKd1/JXWMdNUmtwKsChAXJS3YOciMgIx6tqYUTndrP4I6q1rfriQEiBBAB
AgAMBQJP9T1VBQMAEnUAAAoJEJcQuJvKV618J9wIAI1lId9SMbEHF6PKXRe154lE
pap5imMU/lGTj+9ZcXmlf8o2PoMMmb3/E1k+EZUaeSBoOmjS8C2gwd5XFwRrlwAD
RlK/pG5XsL4h5wmN2fj1ororrJXvqH427PLRQK9yzdwG4+9HTBOxjoS8qZT9plyK
AJZzAydAMqyseRHgNo0vMwlgrs4ojo+GcFGQHrF3IaUjvVfUPOmIj7afopFdIZmI
GaSF0TXBzqcZ1chFv/eTBcIuIKRvlaDee5FgV7+nLH2nKOARCLvV/+8uDi2zbr83
Ip5x2tD3XuUZ0ZWxD0AQWcrLdmGb4lkxbGxvCtsaJHaLXWQ2m760RjIUcwVMEBKJ
ASIEEAECAAwFAlAGYWsFAwASdQAACgkQlxC4m8pXrXwyVAgAvuvEl6yuGkniWOlv
uHEusUv/+2GCBg6qV+IEpVtbTCCgiFjYR5GasSp1gpZ5r4BocOlbGdjdJGHTpyK8
xD1i+6qZWUYhNRg2POXUVzcNEl2hhouwPLOifcmTwAKU76TEv3L5STviL3hWgUR2
yEUZ3Ut0IGVV6uPER9jpR3qd6O3PeuFkwf+NaGTye4jioLAy3aYwtZCUXzvYmNLP
90K4y+5yauZteLmNeq26miKC/NQu4snNFClPbGRjHD1ex9KDiAMttOgN4WEq7srT
rYgtT531WY4deHpNgoPlHPuAfC0H+S6YWuMbgfcb6dV+Rrd8Ij6zM3B/PcjmsYUf
OPdPtIkBIgQQAQIADAUCUBgtfQUDABJ1AAAKCRCXELibyletfAm3CACQlw21Lfeg
d8RmIITsfnFG/sfM3MvZcjVfEAtsY3fTK9NiyU0B3yX0PU3ei37qEW+50BzqiStf
5VhNvLfbZR+yPou7o2MAP31mq3Uc6grpTV64BRIkCmRWg40WMjNI1hv7AN/0atgj
ATYQXgnEw7mfFb0XZtMTD6cmrz/A9nTPVgZDxzopOMgCCC1ZK4Vpq9FKdCYUaHpX
3sqnDf+gpVIHkTCMgWLYQOeX5Nl+fgnq6JppaQ3ySZRUDr+uFUs0uvDRvI/cn+ur
ri92wdDnczjFumKvz/cLJAg5TG2Jv1Jx3wecALsVqQ3gL7f7vr1OMaqhI5FEBqdN
29L9cZe/ZmkriQEiBBIBCgAMBQJVoNxyBYMHhh+AAAoJEEoz7NUmyPxLD1EH/2eh
7a4+8A1lPLy2L9xcNt2bifLfFP2pEjcG6ulBoMKpHvuTCgtX6ZPdHpM7uUOje/F1
CCN0IPB533U1NIoWIKndwNUJjughtoRM+caMUdYyc4kQm29Se6hMPDfyswXE5Bwe
PmoOm4xWPVOH/cVN04zyLuxdlQZNQF/nJg6PMsz4w5z+K6NGGm24NEPcc72iv+6R
Uc/ry/7v5cVu4hO5+r104mmNV5yLecQF13cHy2JlngIHXPSlxTZbeJX7qqxE7TQh
5nviSPgdk89oB5jFSx4g1efXiwtLlP7lbDlxHduomyQuH9yqmPZMbkJt9uZDc8Zz
MYsDDwlc7BIe5bGKfjqJAhwEEAECAAYFAlSanFIACgkQdzHqU52lcqLdvg//cAEP
qdN5VTKWEoDFjDS4I6t8+0KzdDWDacVFwKJ8RAo1M2SklDxnIvnzysZd2VHp5Pq7
i4LYCZo5lDkertQ6LwaQxc4X6myKY4LTA652ObFqsSfgh9kW+aJBBAyeahPQ8CDD
+Yl23+MY5wTsj4qt7KffNzy78vLbYnVnvRQ3/CboVix0SRzg0I3Oi7n3B0lihvXy
5goy9ikjzZevejMEfjfeRCgoryy9j5RvHH9PF3fJVtUtHCS4f+kxLmbQJ1XqNDVD
hlFzjz8oUzz/8YXy3im5MY7Zuq4P4wWiI7rkIFMjTYSpz/evxkVlkR74qOngT2pY
VHLyJkqwh56i0aXcjMZiuu2cymUt2LB9IsaMyWBNJjXr2doRGMAfjuR5ZaittmML
yZwix9mWVk7tkwlIxmT/IW6Np0qMhDZcWYqPRpf7+MqY3ZYMK4552b8aDMjhXrnO
OwLsz+UI4bZa1r9dguIWIt2C2b5C1RQ9AsQBPwg7h5P+HhRuFAuDKK+vgV8FRuzR
JeKkFqwB4y0Nv7BzKbFKmP+V+/krRv+/Dyz9Bz/jyAQgw02u1tPupH9BGhlRyluN
yCJFTSNj7G+OLU0/l4XNph5OOC7sy+AMZcsL/gsT/TXCizRcCuApNTPDaenACpbv
g8OoIzmNWhh4LXbAUHCKmY//hEw9PvTZA1xKHgyJAhwEEgECAAYFAlJYsKQACgkQ
oirk60MpxUV2XQ//b2/uvThkkbeOegusDC4AZfjnL/V3mgk4iYy4AC9hum0R9oNl
XDR51P1TEw9mC1btHj+7m7Iq1a5ke5wIC7ENZiilr0yPqeWgL5+LC98dz/L85hqA
wIoGeOfMhrlaVbAZEj4yQTAJDA35vZHVsQmp87il0m+fZX04OBLXBzw86EoAAZ7Q
EoH4qFcT9k1T363tvNnIm3mEvkQ5WjE1R9uchJa1g7hdlNQlVkjFmPZrJK9fl4z5
6Dto89Po4Sge48jDH0pias4HATYHsxW819nz5jZzGcxLnFRRR5iITVZi9qzsHP7N
bUh3qxuWCHS9xziXpOcSZY848xXw63Y5jDJfpzupzu/KHj6CzXYJUEEqp9MluoGb
/BCCEPzdZ0ovyxFutM/BRcc6DvE6sTDF/UES21ROqfuwtJ6qJYWX+lBIgyCJvj4o
RdbzxUleePuzqCzmwrIXtoOKW0Rlj4SCeF9yCwUMBTGW5/nCLmN4dwf1KW2RP2Eg
4ERbuUy7QnwRP5UCl+0ISZJyYUISfg8fmPIdQsetUK9Cj+Q5jpB2GXwELXWnIK6h
K/6jXp+EGEXSqdIE53vAFe7LwfHiP/D5M71D2h62sdIOmUm3lm7xMOnM5tKlBiV+
4jJSUmriCT62zo710+6iLGqmUUYlEll6Ppvo8yuanXkYRCFJpSSP7VP0bBqIZgQT
EQIAJgUCTnc9dgIbIwUJEPPzpwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEIxx
jTtQcuH1Ut4AoIKjhdf70899d+7JFq3LD7zeeyI0AJ9Z+YyE1HZSnzYi73brScil
bIV6sbQ7TXlTUUwgUGFja2FnZSBzaWduaW5nIGtleSAod3d3Lm15c3FsLmNvbSkg
PGJ1aWxkQG15c3FsLmNvbT6IbwQwEQIALwUCTnc9rSgdIGJ1aWxkQG15c3FsLmNv
bSB3aWxsIHN0b3Agd29ya2luZyBzb29uAAoJEIxxjTtQcuH1tT0An3EMrSjEkUv2
9OX05JkLiVfQr0DPAJwKtL1ycnLPv15pGMvSzav8JyWN3IhlBBMRAgAdBQJHrJS0
BQkNMFioBQsHCgMEAxUDAgMWAgECF4AAEgkQjHGNO1By4fUHZUdQRwABAa6SAJ9/
PgZQSPNeQ6LvVVzCALEBJOBt7QCffgs+vWP18JutdZc7XiawgAN9vmmITAQTEQIA
DAUCPj6j0QWDCWYAuwAKCRBJUOEqsnKR8iThAJ9ZsR4o37dNGyl77nEqP6RAlJqa
YgCeNTPTEVY+VXHR/yjfyo0bVurRxT2ITAQTEQIADAUCPkKCAwWDCWIiiQAKCRC2
9c1NxrokP5aRAKCIaaegaMyiPKenmmm8xeTJSR+fKQCgrv0TqHyvCRINmi6LPucx
GKwfy7KIRgQQEQIABgUCP6zjrwAKCRCvxSNIeIN0D/aWAKDbUiEgwwAFNh2n8gGJ
Sw/8lAuISgCdHMzLAS26NDP8T2iejsfUOR5sNriIRgQQEQIABgUCP7RDdwAKCRCF
lq+rMHNOZsbDAJ0WoPV+tWILtZG3wYqg5LuHM03faQCeKuVvCmdPtro06xDzeeTX
VrZ14+GIRgQQEQIABgUCQ1uz6gAKCRCL2C5vMLlLXH90AJ0QsqhdAqTAk3SBnO2w
zuSOwiDIUwCdFExsdDtXf1cL3Q4ilo+OTdrTW2CIRgQTEQIABgUCRPEzJgAKCRD2
ScT0YJNTDApxAKCJtqT9LCHFYfWKNGGBgKjka0zi9wCcCG3MvnvBzDUqDVebudUZ
61Sont+ITAQQEQIADAUCQYHLAQWDBiLZiwAKCRAYWdAfZ3uh7EKNAJwPywk0Nz+Z
Lybw4YNQ7H1UxZycaQCePVhY4P5CHGjeYj9SX2gQCE2SNx+ITAQQEQIADAUCQYHL
NAWDBiLZWAAKCRCBwvfr4hO2kiIjAJ0VU1VQHzF7yYVeg+bh31nng9OOkwCeJI8D
9mx8neg4wspqvgXRA8+t2saITAQQEQIADAUCQYHLYgWDBiLZKgAKCRBrcOzZXcP0
cwmqAJsFjOvkY9c5eA/zyMrOZ1uPB6pd4QCdGyzgbYb/eoPu6FMvVI9PVIeNZReI
TAQQEQIADAUCQdCTJAWDBdQRaAAKCRB9JcoKwSmnwmJVAKCG9a+Q+qjCzDzDtZKx
5NzDW1+W+QCeL68seX8OoiXLQuRlifmPMrV2m9+ITAQQEQIADAUCQitbugWDBXlI
0gAKCRDmG6SJFeu5q/MTAKCTMvlCQtLKlzD0sYdwVLHXJrRUvgCffmdeS6aDpwIn
U0/yvYjg1xlYiuqITAQSEQIADAUCQCpZOgWDB3pLUgAKCRA8oR80lPr4YSZcAJwP
4DncDk4YzvDvnRbXW6SriJn1yQCdEy+d0CqfdhM7HGUs+PZQ9mJKBKqITAQSEQIA
DAUCQD36ugWDB2ap0gAKCRDy11xj45xlnLLfAKC0NzCVqrbTDRw25cUss14RRoUV
PACeLpEc3zSahJUB0NNGTNlpwlTczlCITAQSEQIADAUCQQ4KhAWDBpaaCAAKCRA5
yiv0PWqKX/zdAJ4hNn3AijtcAyMLrLhlZQvib551mwCgw6FEhGLjZ+as0W681luc
wZ6PzW+ITAQSEQIADAUCQoClNAWDBSP/WAAKCRAEDcCFfIOfqOMkAJwPUDhS1eTz
gnXclDKgf353LbjvXgCeLCWyyj/2d0gIk6SqzaPl2UcWrqiITAQTEQIADAUCPk1N
hAWDCVdXCAAKCRAtu3a/rdTJMwUMAKCVPkbk1Up/kyPrlsVKU/Nv3bOTZACfW5za
HX38jDCuxsjIr/084n4kw/uITAQTEQIADAUCQdeAdgWDBc0kFgAKCRBm79vIzYL9
Pj+8AJ9d7rvGJIcHzTCSYVnaStv6jP+AEACeNHa5yltqieRBCCcLcacGqYK81omI
TAQTEQIADAUCQhiBDgWDBYwjfgAKCRB2wQMcojFuoaDuAJ9CLYdysef7IsW42UfW
hI6HjxkzSgCfeEpXS4hEmmGicdpRiJQ/W21aB0GIZQQTEQIAHQULBwoDBAMVAwID
FgIBAheABQJLcC/KBQkQ8/OnABIHZUdQRwABAQkQjHGNO1By4fWw2wCeJilgEarL
8eEyfDdYTyRdqE45HkoAnjFSZY8Zg/iXeErHI0r04BRukNVgiHsEMBECADsFAkJ3
NfU0HQBPb3BzLi4uIHNob3VsZCBoYXZlIGJlZW4gbG9jYWwhIEknbSAqc28qIHN0
dXBpZC4uLgAKCRA5yiv0PWqKX+9HAJ0WjTx/rqgouK4QCrOV/2IOU+jMQQCfYSC8
JgsIIeN8aiyuStTdYrk0VWCIjwQwEQIATwUCRW8Av0gdAFNob3VsZCBoYXZlIGJl
ZW4gYSBsb2NhbCBzaWduYXR1cmUsIG9yIHNvbWV0aGluZyAtIFdURiB3YXMgSSB0
aGlua2luZz8ACgkQOcor9D1qil+g+wCfcFWoo5qUl4XTE9K8tH3Q+xGWeYYAnjii
KxjtOXc0ls+BlqXxbfZ9uqBsiQIiBBABAgAMBQJBgcuFBYMGItkHAAoJEKrj5s5m
oURoqC8QAIISudocbJRhrTAROOPoMsReyp46Jdp3iL1oFDGcPfkZSBwWh8L+cJjh
dycIwwSeZ1D2h9S5Tc4EnoE0khsS6wBpuAuih5s//coRqIIiLKEdhTmNqulkCH5m
imCzc5zXWZDW0hpLr2InGsZMuh2QCwAkB4RTBM+r18cUXMLV4YHKyjIVaDhsiPP/
MKUj6rJNsUDmDq1GiJdOjySjtCFjYADlQYSD7zcd1vpqQLThnZBESvEoCqumEfOP
xemNU6xAB0CL+pUpB40pE6Un6Krr5h6yZxYZ/N5vzt0Y3B5UUMkgYDSpjbulNvaU
TFiOxEU3gJvXc1+h0BsxM7FwBZnuMA8LEA+UdQb76YcyuFBcROhmcEUTiducLu84
E2BZ2NSBdymRQKSinhvXsEWlH6Txm1gtJLynYsvPi4B4JxKbb+awnFPusL8W+gfz
jbygeKdyqzYgKj3M79R3geaY7Q75Kxl1UogiOKcbI5VZvg47OQCWeeERnejqEAdx
EQiwGA/ARhVOP/1l0LQA7jg2P1xTtrBqqC2ufDB+v+jhXaCXxstKSW1lTbv/b0d6
454UaOUV7RisN39pE2zFvJvY7bwfiwbUJVmYLm4rWJAEOJLIDtDRtt2h8JahDObm
3CWkpadjw57S5v1c/mn+xV9yTgVx5YUfC/788L1HNKXfeVDq8zbAiQIiBBMBAgAM
BQJCnwocBYMFBZpwAAoJENjCCglaJFfPIT4P/25zvPp8ixqV85igs3rRqMBtBsj+
5EoEW6DJnlGhoi26yf1nasC2frVasWG7i4JIm0U3WfLZERGDjR/nqlOCEqsP5gS3
43N7r4UpDkBsYh0WxH/ZtST5llFK3zd7XgtxvqKL98l/OSgijH2W2SJ9DGpjtO+T
iegq7igtJzw7Vax9z/LQH2xhRQKZR9yernwMSYaJ72i9SyWbK3k0+e95fGnlR5pF
zlGq320rYHgD7v9yoQ2t1klsAxK6e3b7Z+RiJG6cAU8o8F0kGxjWzF4v8D1op7S+
IoRdB0Bap01ko0KLyt3+g4/33/2UxsW50BtfqcvYNJvU4bZns1YSqAgDOOanBhg8
Ip5XPlDxH6J/3997n5JNj/nk5ojfd8nYfe/5TjflWNiput6tZ7frEki1wl6pTNbv
V9C1eLUJMSXfDZyHtUXmiP9DKNpsucCUeBKWRKLqnsHLkLYydsIeUJ8+ciKc+EWh
FxEY+Ml72cXAaz5BuW9L8KHNzZZfez/ZJabiARQpFfjOwAnmhzJ9r++TEKRLEr96
taUI9/8nVPvT6LnBpcM38Td6dJ639YvuH3ilAqmPPw50YvglIEe4BUYD5r52Seqc
8XQowouGOuBX4vs7zgWFuYA/s9ebfGaIw+uJd/56Xl9ll6q5CghqB/yt1EceFEnF
CAjQc2SeRo6qzx22iEYEEBECAAYFAkSAbycACgkQCywYeUxD5vWDcACfQsVk/XGi
ITFyFVQ3IR/3Wt7zqBMAoNhso/cX8VUfs2BzxPvvGS3y+5Q9iEYEEBECAAYFAkUw
ntcACgkQOI4l6LNBlYkyFgCbBcw5gIii0RTDJsdNiuJDcu/NPqEAniSq9iTaLjgF
HZbaizUU8arsVCB5iEYEEBECAAYFAkWho2sACgkQu9u2hBuwKr6bjwCfa7ZK6O+X
mT08Sysg4DEoZnK4L9UAoLWgHuYg35wbZYx+ZUTh98diGU/miF0EExECAB0FAj4+
owwFCQlmAYAFCwcKAwQDFQMCAxYCAQIXgAAKCRCMcY07UHLh9XGOAJ4pVME15/DG
rUDohtGv2z8a7yv4AgCeKIp0jWUWE525QocBWms7ezxd6syIXQQTEQIAHQUCR6yU
zwUJDTBYqAULBwoDBAMVAwIDFgIBAheAAAoJEIxxjTtQcuH1dCoAoLC6RtsD9K3N
7NOxcp3PYOzH2oqzAKCFHn0jSqxk7E8by3sh+Ay8yVv0BYhdBBMRAgAdBQsHCgME
AxUDAgMWAgECF4AFAkequSEFCQ0ufRUACgkQjHGNO1By4fUdtwCfRNcueXikBMy7
tE2BbfwEyTLBTFAAnifQGbkmcARVS7nqauGhe1ED/vdgiF0EExECAB0FCwcKAwQD
FQMCAxYCAQIXgAUCS3AuZQUJEPPyWQAKCRCMcY07UHLh9aA+AKCHDkOBKBrGb8tO
g9BIub3LFhMvHQCeIOOot1hHHUlsTIXAUrD8+ubIeZaJARwEEgECAAYFAkvCIgMA
CgkQ3PTrHsNvDi8eQgf/dSx0R9Klozz8iK79w00NOsdoJY0Na0NTFmTbqHg30XJo
G62cXYgc3+TJnd+pYhYi5gyBixF/L8k/kPVPzX9W0YfwChZDsfTw0iDVmGxOswiN
jzSo0lhWq86/nEL30Khl9AhCC1XFNRw8WZYq9Z1qUXHHJ2rDARaedvpKHOjzRY0N
dx6R2zNyHDx2mlfCQ9wDchWEuJdAv0uHrQ0HV9+xq7lW/Q3L/V5AuU0tiowyAbBL
PPYrB6x9vt2ZcXS7BOy8SfQ1i8W2QDQ/Toork4YwBiv6WCW/ociy7paAoPOWV/Nf
2S6hDispeecbk7wqpbUj5klDmwrlgB/jmoAXWEnbsYkBIgQQAQIADAUCSSpooAUD
ABJ1AAAKCRCXELibyletfFOMCACpP+OVZ7lH/cNY+373c4FnSI0/S5PXS0ABgdd4
BFWRFWKrWBeXBGc8sZfHOzVEwkzV96iyHbpddeAOAkEA4OVPW1MMFCmlHxi2s9/N
JrSrTPVfQOH5fR9hn7Hbpq/ETw0IoX1FKo7vndMnHZnFEnI+PDXLcdMYQgljYzhT
xER4vYY0UKu8ekSshUy4zOX7XSJxwqPUvps8qs/TvojIF+vDJvgFYHVkgvS+shp8
Oh/exg9vKETBlgU87Jgsqn/SN2LrR/Jhl0aLd0G0iQ+/wHmVYdQUMFaCZwk/BKNa
XPzmGZEUZ3RNbYa19Mo7hcE3js76nh5YMxFvxbTggVu4kdFkiQEiBBABAgAMBQJK
M06IBQMAEnUAAAoJEJcQuJvKV618F4gH/innejIHffGMk8jYix4ZZT7pW6ApyoI+
N9Iy85H4L+8rVQrtcTHyq0VkcN3wPSwtfZszUF/0qP6P8sLJNJ1BtrHxLORYjJPm
gveeyHPzA2oJl6imqWUTiW822fyjY/azwhvZFzxmvbFJ+r5N/Z57+Ia4t9LTSqTN
HzMUYaXKDaAqzZeK7P0E6XUaaeygbjWjBLQ1O0ezozAy+Kk/gXApmDCGFuHSFe7Z
mgtFcbXLM2XFQpMUooETD2R8MUsd+xnQsff/k6pQOLxi+jUEsWSr/iqmvlk6gZ4D
pemBjuhcXYlxJYjUaX9Zmn5s+ofF4GFxRqXoY7l9Z+tCM9AX37lm6S+JASIEEAEC
AAwFAkpEcgoFAwASdQAACgkQlxC4m8pXrXz2mgf/RQkpmMM+5r8znx2TpRAGHi5w
ktvdFxlvPaOBWE28NDwTrpcoMqo9kzAiuvEQjVNihbP21wR3kvnQ84rTAH0mlC2I
uyybggpqwzOUl+Wi0o+vk8ZA0A0dStWRN8uqneCsd1XnqDe1rvqC4/9yY223tLmA
kPvz54ka2vX9GdJ3kxMWewhrVQSLCktQpygU0dujGTDqJtnk0WcBhVF9T87lv3W2
eGdPielzHU5trXezmGFj21d56G5ZFK8co7RrTt4qdznt80glh1BTGmhLlzjMPLTe
dcMusm3D1QB9ITogcG94ghSf9tEKmmRJ6OnnWM5Kn9KcL63E5oj2/lY9H54wSYkB
IgQQAQIADAUCSlY+RwUDABJ1AAAKCRCXELibyletfOOQB/0dyJBiBjgf+8d3yNID
pDktLhZYw8crIjPBVdOgX12xaUYBTGcQITRVHSggzffDA5BQXeUuWhpL4QB0uz1c
EPPwSMiWiXlBtwF5q6RVf3PZGJ9fmFuTkPRO7SruZeVDo9WP8HjbQtOLukYf566e
grzAYR9p74UgWftpDtmrqrRTobiuvsFBxosbeRCvEQCrN0n+p5D9hCVB88tUPHnO
WA4mlduAFZDxQWTApKQ92frHiBqy+M1JFezz2OM3fYN+Dqo/Cb7ZwOAA/2dbwS7o
y4sXEHbfWonjskgPQwFYB23tsFUuM4uZwVEbJg+bveglDsDStbDlfgArXSL/0+ak
lFcHiQEiBBABAgAMBQJKaAqEBQMAEnUAAAoJEJcQuJvKV618rH0H/iCciD4U6YZN
JBj0GN7/Xt851t9FWocmcaC+qtuXnkFhplXkxZVOCU4VBMs4GBoqfIvagbBTyfV4
Di+W8Uxr+/1jiu3l/HvoFxwdwNkGG6zNBhWSjdwQpGwPvh5ryV1OfLX/mgQgdDmx
vqz5+kFDUj4m7uLaeuU2j1T0lR4zU0yAsbt7J3hwfqJCXHOc9bm5nvJwMrSm+sdC
TP5HjUlwHr9mTe8xuZvj6sO/w0P4AqIMxjC9W7pT9q0ofG2KSTwt7wFbh05sbG4U
QYOJe4+Soh3+KjAa1c0cvmIh4cKX9qfCWwhhdeNfh1A9VTHhnl5zTv/UjvnQtjhl
H/Fq1eBSKcSJASIEEAECAAwFAkp5LgoFAwASdQAACgkQlxC4m8pXrXwY6wgAg3f8
76L3qDZTYlFAWs3pXBl8GsUr1DEkTlEDZMZKDM3wPmhaWBR1hMA3y6p3aaCUyJIJ
BEneXzgyU9uqCxXpC78d5qc3xs/Jd/SswzNYuvuzLYOw5wN5L31SLmQTQ8KqE0uo
RynBmtDCQ4M2UKifSnv+0+3mPh85LVAS481GNpL+VVfCYtKesWNu40+98Yg6L9NG
WwRTfsQbcdokZo44Jz7Y7f81ObC4r/X1DgPj2+d4AU/plzDcdrbINOyprs+7340e
cnaGO4Lsgd19b1CvcgJgltRquu3kRvd+Ero2RYpDv6GVK8Ea0Lto4+b/Ae8cLXAh
QnaWQCEWmw+AU4Jbz4kBIgQQAQIADAUCSo5fvQUDABJ1AAAKCRCXELibyletfA08
B/9w8yJdc8K+k07U30wR/RUg3Yb2lBDygmy091mVsyB0RGixBDXEPOXBqGKAXiV1
QSMAXM2VKRsuKahY2HFkPbyhZtjbdTa7Pr/bSnPvRhAh9GNWvvRg2Kp3qXDdjv9x
ywEghKVxcEIVXtNRvpbqRoKmHzIExvUQck5DM1VwfREeYIoxgs4035WADhVMdngQ
S2Gt8P2WaU/p8EZhFGg6X8KtOlD68zGboaJe0hj2VDc+Jc+KdjRfE3fW5IToid/o
DkUaIW6tB3WkXb0g6D/2hrEJbX3headChHKSB8eQdOR9bcCJDhhU8csd501qmrhC
ctmvlpeWQZdIQdk6sABPWeeCiQEiBBABAgAMBQJKoBJHBQMAEnUAAAoJEJcQuJvK
V618Ml8H/1D88/g/p9fSVor4Wu5WlMbg8zEAik3BIxQruEFWda6nART6M9E7e+P1
++UHZsWYs6l9ROpWxRLG1Yy9jLec2Y3nUtb20m65p+IVeKR2a9PHW35WZDV9dOYP
GZabKkO1clLeWLVgp9LRjZ+AeRG+ljHqsULXro1dwewLTB/gg9I2vgNv6dKxyKak
nM/GrqZLATAq2KoaE/u/6lzRFZIzZnLtjZh8X7+nS+V8v9IiY4ntrpkrbvFk30U6
WJp79oBIWwnW/84RbxutRoEwSar/TLwVRkcZyRXeJTapbnLGnQ/lDO1o1d7+Vbjd
q/Sg/cKHHf7NthCwkQNsCnHL0f51gZCJASIEEAECAAwFAkqoEAAFAwASdQAACgkQ
lxC4m8pXrXwE/Af/XD4R/A5R6Ir/nCvKwCTKJmalajssuAcLEa2pMnFZYO/8rzLO
+Gp8p0qFH9C4LFwA0NvR5q6X/swuROf4zxljSvNcdlQVaAfJ2ZDEgJ5GXzsPplrv
SAI9jS3LL7fSWDZgKuUe0a4qx7A0NgyGMUYGhP+QlRFa8vWEBI9fANd/0mMqAeBV
qQyOH0X1FiW1Ca2Jn4NKfuMy9GEvRddVIbB1LvoNVtXPNzeeKMyNb9Jdx1MFWssy
COBP2DayJKTmjvqPEc/YOjOowoN5sJ/jn4mVSTvvlTooLiReSs6GSCAjMVxN7eYS
/Oyq6Iu1JDcJvmB8N2WixAZtAVgF8OA7CWXKVYkBIgQQAQIADAUCSrnHiQUDABJ1
AAAKCRCXELibyletfPChB/9uECti1dZeNuFsd0/RuGyRUVlrrhJE6WCcOrLO9par
rPbewbKBmjSzB0MygJXGvcC06mPNuquJ7/WpxKsFmfg4vJBPlADFKtgRUy9BLzjC
eotWchPHFBVW9ftPbaQViSUu7d89NLjDDM5xrh80puDIApxoQLDoIrh3T1kpZx56
jSWv0gelFUMbXAzmqkJSyL4Xdh1aqzgUbREd7Xf2ICzuh0sV6V7c/AwWtjWEGEsA
HZaiQDywZwbC18GwrMLiAzGWb/AScFDQRCZKJDjL+Ql8YT6z+ZMVr8gb7CIU5PKY
dhiIf2UVTQwLAoW7lNRCQQAqcGjK3IMIz7SO/yk4HmVUiQEiBBABAgAMBQJK3gjG
BQMAEnUAAAoJEJcQuJvKV618jkEH+wb0Zv9z7xQgpLMowVuBFQVu8/z7P5ASumyB
PUO3+0JVxSHBhlCKQK7n11m1fhuGt2fCxXhSU6LzXj36rsKRY53lGZ9QhvqFUtQH
3Xb2IQLIJC4UKjG2jSSCdcuA/x98bwp2v7O03rn7ndCS16CwXnRV3geQoNipRKMS
DajKPpZv1RiZm8pMKqEb8WSw352xWoOcxuffjlsOEwvJ85SEGCAZ9tmIlkZOc7Ai
QONDvii9b8AYhQ60RIQC0HP2ASSmK0V92VeFPxHmAygdDQgZNVtbVxgnnt7oTNEu
VRXNY+z4OfBArp7R+cTsvijDRZY4kML1n22hUybwoxUEvjqZV2+JASIEEAECAAwF
AkrvOlQFAwASdQAACgkQlxC4m8pXrXxrPAgArXiNgZirNuBhfNCXlkzkCHLx5wnV
e4SmTpbWzTwWw7+qk7d4l9hlWtdImISORINzo7f4ShSUzJX2GciNaXhaHRo7+y5O
Zbu82jQb09aQQj/nibKYuqxqUrobTEm+DuYz3JUQZm2PsPcHLS8mX9cxvrJUncPG
nXEV0DRaq71SGWDprtkvBbp6i38aY3sIhYgz8wM5m1szKDtjywmBYcFehIdozt9z
hm7wZshzRWQX1+Rf/pIsnk+OzBIa34crSemTnacbV/B7278z2XAyziPNFuqz0xu+
iltOmYmayfNWAmumuw9NcuwWMlth6Mc2HLrpo0ZBheJ6iuDMPsHnwqdB/4kBIgQQ
AQIADAUCSwBd2gUDABJ1AAAKCRCXELibyletfP6tB/4m1w0BtlkJgtS6E+B/ns14
z4A4PGors+n+MYm05qzvi+EnDF/sytCmVcKeimrtvDcfoDtKAFFvJjcYXfnJdGWm
Pu0SJMRL5KKCirAKwZmU/saxOgoB5QLNw+DHPteJ3w9GmWlGxIqG1r15WC5duzBC
y3FsnjJYG3jaLnHOO9yXXb5h0kUTORfUKdvAr1gxF2KoatZWqGoaPPnHoqb88rjt
zk8I7gDqoXnzh8wLxa0ZYvfTC/McxdWTrwXLft+krmMQ18iIZEne2hvVLNJVuluU
oiWLeHA8iNCQ4W4WTdLc1mCnCjGTMX/MN41uLH0C9Ka4R6wEaqj4lPDk1B/1TV+Q
iQEiBBABAgAMBQJLEYGrBQMAEnUAAAoJEJcQuJvKV618naIH/2t9aH5mBTKBN6fU
qhrf79vIsjtI/QNS5qisBISZMX3/1/0Gu6WnxkPSfdCUJMWCjMcnVj7KU2wxTHHG
VpAStd9r2afUNxRyqZwzwyytktuZok0XngAEDYDDBS3ssu2R4uWLCsC2ysXEqO/5
tI5YrTWJZrfeIphTaYP5hxrMujvqy3kEwKKbiMz91cDeiLS+YCBcalj5n/1dMYf7
8U8C6ieurxAg/L8h6x25VM4Ilx4MmG2T8QGtkkUXd+Fd/KYWmf0LE5LLPknf0Hhw
oVslPXeinp4FsHK/5wzviv4YZpzuTqs9NlKcMsa4IuuPOB0FDf0pn+OFQbEg9QwY
2gCozK+JASIEEAECAAwFAksjTdQFAwASdQAACgkQlxC4m8pXrXwlogf/XBGbXRVX
LMaRN4SczOjwT3/tUCriTkb3v+zKjRG90zFhYAccjn7w+7jKQicjq6quQG1EH2X4
/Su6ps1lDLqGHHhiJW3ZhxQScLZmhdAYsh2qG4GP/UW3QjXG7c61t+H3olvWg2cr
wqCxxFZAgkAAkr9xcHWFZJEQeXoob6cCZObaUnHSANdmC6s5lUxXYa2bmL7Q3UB4
4KCzDvAfbPZKJOw9k0qb3lc11zx+vGdyZFbm4R0+3LPp/vT0b3GlSbbF9lU1GOXh
VaphrgFFa76dmjfHCkPplXAkK1VSIU/aPGAefduTFMdlSZpdMtJ5AULjGcszBDlR
pLlPxvqVa0ZpgIkBIgQQAQIADAUCSycmkgUDABJ1AAAKCRCXELibyletfHlNCACp
1YespiHfQt2alcscE5zgfETEHHic8Ai6pNkU9HT4TeWcFHEDe5QqfYcpjLrQvBXS
kSvxEittbyRdv+e+j5Z+HyHjiG8nAQBL6qy9eHqQE4+d7gYs6DTk7sG9ZMYphREb
ltzD+F4hVCQdLT8LNr0eVFN7ehqECScDaCG8/Qyti+l/0M902/Yn+mz0ilOiUdWJ
9x6LPaIINtb1gsYDEylLjwGIZmI0r5Kh9wYoV4vnNezFbxO1uRiW0B7iaPjIEsbt
OOKp7wx2aX+DM3N9F3BtaIY8XnzcnomNm83SNsgmgrZljpQltUnNqIhNM8DupQ+I
WOV5gtl6pTC7CgeVTVyRiQEiBBABAgAMBQJLOGXuBQMAEnUAAAoJEJcQuJvKV618
ll4IAKJ9mm4jb0c8fe9+uDI8eCJRbzNbVXm8zWzpA8GUtQAakwxoKv332QP1Wa1P
odni/e3EMhsSREOZJJv79YqGxGRBTE9Kb/VjM34nas4XSnXKW28XWhKyIw+XwQAi
nY2swFHh+83Htr/mwTdJfS2aEYl2zboBvd/JZCdhOGU2GH737S/3uEczoKkfVQ/w
OTM8X1xWwlYWqx23k/DsGcuDs9lA2g7Mx7DSqBtVjaTkn9h0zATzXLDkmP4SAUVj
cZ83WDpFre5WnizZjdXlBMM5OCexp5WpmzyHLTnaBFK4jEmnsk5C2Rnoyp8Ivz6g
Ecg1tRbEXijRw++d2TFYlJwLKtiJASIEEAECAAwFAktKMicFAwASdQAACgkQlxC4
m8pXrXxqHQgAuYY5scKrh0m/GS9EYnyC9494lOlO6iytU0CpE6oBC31M3hfX/Dbj
UbcS5szZNU+2CPYo4ujQLZ7suN7+tTjG6pZFfMevajT9+jsL+NPMF8RLdLOVYmbl
TmSQGNO+XGEYaKYH5oZIeIW5AKCgi2ozkdFlBBLAx7Kqo/FyybhkURFEcvEyVmgf
3KLV7IIiX/fYLfoCMCJ/Lcm9/llSFB1n8Nvg66Xd533DKoHjueD3jyaNAVlo2mq/
sIAv++kntvOiB3GDK5pfwHZ78WWiCpsWZpE5gzAnzJ1Y0WEigRo0PVLu3cLO0jLG
23d+H/CbfZ8rkajHJeCDQF7YVmP0t0nYpYkBIgQQAQIADAUCS1v+ZgUDABJ1AAAK
CRCXELibyletfNS/CACqt2TkB86mjqM+cJ74+dWBvJ2aFuURuxzm95i9Q/W/hU08
2iMbC3+0k2oD8CrTOe61P+3oRyLjv/UEDUNzLncNe2YsA9JeV+4hvPwH5Vp3Om13
089fCKZUbqslXNKkHiWYU+zAaZJXEuGRmRz0HbQIeAMOWF4oa226uo1e4ws1Jhc+
F3E/ApCRyFBqBUdL05hapQLditYpsBjIdiBGpjzidMLE2wX2W4ZpAdN0U6BIyIqR
mTPjbSkvzS9kSWFmfhQgnBDKEYJpVZgE1sN52rYC1sDeGeiuKxlzjVov9MMhYMWa
Zo3R5o3F2iIM/BK6FbC252lf/Mhu3ICuXujNBZNYiQEiBBABAgAMBQJLbSH4BQMA
EnUAAAoJEJcQuJvKV618kd0IAJLLwDH6gvgAlBFklQJXqQxUdcSOOVMAWtlHgWOy
ozjgomZZBkRL8dtCDr9YBMcj5czcQ3qpmLJdppXhKB+kJV2iUXfDMSFXwJ4wLfIs
8FNnXw8H5U01oBkGH/Ku6ngL9Vwt+MjYHtCWkw9QueUKZnDudX9qIzLAIt+mwSTu
A6+fY4VWIg40AA0v3exaQM55YR/UhlKunpGG9o8Qkq77dMEbTMpOmBoLbOMRB3Dd
MAvVU6G2l6Pcb7KobVCuOBnb6batXARV/G8sw+nzfJ16fr/KobZT2A6m+Jrqk4dl
F14ljLbz16O5JGUPAryN2G2ddBdSAy7dtFSVhWWiWC9n88q5Ag0EPj6jHRAIAO/h
iX8WzHWOMLJT54x/axeDdqn1rBDf5cWmaCWHN2ujNNlgpx5emoU9v7QStsNUCOGB
bXkeO4Ar7YG+jtSR33zqNh3y5kQ0YkY3dQ0wh6nsl+wh4XIIY/3TUZVtmdJeUBRH
JlfVNFYad2hX1guFI37Ny1PoZAFsxO82g+XB/Se8r/+sbmVcONdcdIeFKrE3FjLt
IjNQcxC6l9Q2Oy8KDxG/zvUZG3+H5i3tdRMyGgmuD6gEV0GXOHYUopzLeit1+Aa0
bCk36Mwbu+BeOw/CJW3+b0mB27hOaf9aCA855IP6fJFvtxcblq8nHIqhU3Dc9tec
sl9/S1xZ5S8ylG/xeRsAAwUH/i8KqmvAhq0X7DgCcYputwh37cuZlHOa1Ep07JRm
BCDgkdQXkGrsj2Wzw7Aw/TGdWWkmn2pxb8BRui5cfcZFO7c6vryi6FpJuLucX975
+eVY50ndWkPXkJ1HF4i+HJwRqE2zliN/RHMs4LJcwXQvvjD43EE3AO6eiVFbD+qA
AdxUFoOeLblKNBHPG7DPG9xL+Ni5rkE+TXShxsB7F0z7ZdJJZOG0JODmox7IstQT
GoaU9u41oyZTIiXPiFidJoIZCh7fdurP8pn3X+R5HUNXMr7M+ba8lSNxce/F3kmH
0L7rsKqdh9d/aVxhJINJ+inVDnrXWVoXu9GBjT8Nco1iU9SIVAQYEQIADAUCTnc9
7QUJE/sBuAASB2VHUEcAAQEJEIxxjTtQcuH1FJsAmwWK9vmwRJ/y9gTnJ8PWf0BV
roUTAKClYAhZuX2nUNwH4vlEJQHDqYa5yQ==
=HfUN
-----END PGP PUBLIC KEY BLOCK-----
</pre><p>
        To import the build key into your personal public GPG keyring,
        use <span class="command"><strong>gpg --import</strong></span>. For example, if you have
        saved the key in a file named
        <code class="filename">mysql_pubkey.asc</code>, the import command looks
        like this:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gpg --import mysql_pubkey.asc</code></strong>
gpg: key 5072E1F5: public key "MySQL Release Engineering
&lt;mysql-build@oss.oracle.com&gt;" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no ultimately trusted keys found
</pre><p>
        You can also download the key from the public keyserver using
        the public key id, <code class="literal">5072E1F5</code>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; gpg --recv-keys 5072E1F5
gpg: requesting key 5072E1F5 from hkp server keys.gnupg.net
gpg: key 5072E1F5: "MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;"
1 new user ID
gpg: key 5072E1F5: "MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;"
53 new signatures
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:           new user IDs: 1
gpg:         new signatures: 53
</pre><p>
        If you want to import the key into your RPM configuration to
        validate RPM install packages, you should be able to import the
        key directly:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpm --import mysql_pubkey.asc</code></strong>
</pre><p>
        If you experience problems or require RPM specific information,
        see <a class="xref" href="installing.html#checking-rpm-signature" title="2.1.3.4 Signature Checking Using RPM">Section 2.1.3.4, “Signature Checking Using RPM”</a>.
      </p><p>
        After you have downloaded and imported the public build key,
        download your desired MySQL package and the corresponding
        signature, which also is available from the download page. The
        signature file has the same name as the distribution file with
        an <code class="filename">.asc</code> extension, as shown by the examples
        in the following table.
</p>
<div class="table">
<a name="idm139899668597712"></a><p class="title"><b>Table 2.1 MySQL Package and Signature Files for Source files</b></p>
<div class="table-contents">
<table><col width="25%"><col width="75%"><thead><tr>
            <th scope="col">File Type</th>
            <th scope="col">File Name</th>
          </tr></thead><tbody><tr>
            <td scope="row">Distribution file</td>
            <td><code class="literal">mysql-standard-8.0.13-linux-i686.tar.gz</code></td>
          </tr><tr>
            <td scope="row">Signature file</td>
            <td><code class="literal">mysql-standard-8.0.13-linux-i686.tar.gz.asc</code></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
        Make sure that both files are stored in the same directory and
        then run the following command to verify the signature for the
        distribution file:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gpg --verify <em class="replaceable"><code>package_name</code></em>.asc</code></strong>
</pre><p>
        If the downloaded package is valid, you will see a "Good
        signature" similar to:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gpg --verify mysql-standard-8.0.13-linux-i686.tar.gz.asc</code></strong>
gpg: Signature made Tue 01 Feb 2011 02:38:30 AM CST using DSA key ID 5072E1F5
gpg: Good signature from "MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;"
</pre><p>
        The <code class="literal">Good signature</code> message indicates that the
        file signature is valid, when compared to the signature listed
        on our site. But you might also see warnings, like so:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gpg --verify mysql-standard-8.0.13-linux-i686.tar.gz.asc</code></strong>
gpg: Signature made Wed 23 Jan 2013 02:25:45 AM PST using DSA key ID 5072E1F5
gpg: checking the trustdb
gpg: no ultimately trusted keys found
gpg: Good signature from "MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: A4A9 4068 76FC BD3C 4567  70C8 8C71 8D3B 5072 E1F5
</pre><p>
        That is normal, as they depend on your setup and configuration.
        Here are explanations for these warnings:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="emphasis"><em>gpg: no ultimately trusted keys found</em></span>:
            This means that the specific key is not "ultimately trusted"
            by you or your web of trust, which is okay for the purposes
            of verifying file signatures.
          </p></li><li class="listitem"><p>
            <span class="emphasis"><em>WARNING: This key is not certified with a trusted
            signature! There is no indication that the signature belongs
            to the owner.</em></span>: This refers to your level of trust
            in your belief that you possess our real public key. This is
            a personal decision. Ideally, a MySQL developer would hand
            you the key in person, but more commonly, you downloaded it.
            Was the download tampered with? Probably not, but this
            decision is up to you. Setting up a web of trust is one
            method for trusting them.
</p></li></ul>
</div>
<p>
        See the GPG documentation for more information on how to work
        with public keys.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="checking-gpg-signature-windows"></a>2.1.3.3 Signature Checking Using Gpg4win for Windows</h4>

</div>

</div>

</div>
<p>
        The <a class="xref" href="installing.html#checking-gpg-signature" title="2.1.3.2 Signature Checking Using GnuPG">Section 2.1.3.2, “Signature Checking Using GnuPG”</a> section describes
        how to verify MySQL downloads using GPG. That guide also applies
        to Microsoft Windows, but another option is to use a GUI tool
        like <a class="ulink" href="http://www.gpg4win.org/" target="_top">Gpg4win</a>. You
        may use a different tool but our examples are based on Gpg4win,
        and utilize its bundled <code class="literal">Kleopatra</code> GUI.
      </p><p>
        Download and install Gpg4win, and then load Kleopatra. The
        dialog should look similar to:
</p>
<div class="figure">
<a name="gnupg-kleopatra-home"></a><p class="title"><b>Figure 2.1 Kleopatra: Initial Screen</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/gnupg-kleopatra-home.png" width="682" height="436" alt='Shows the default Kleopatra screen. The top menu includes "File", "View", "Certificates", "Tools", "Settings", "Window", and "Help.". Underneath the top menu is a horizontal action bar with available buttons to "Import Certificates", "Redisplay", and "Lookup Certificates on Server". Greyed out buttons are "Export Certificates" and "Stop Operation". Underneath is a search box titled "Find". Underneath that are three tabs: "My Certificates", "Trusted Certificates", and "Other Certificates" with the "My Certificates" tab selected. "My Certificates" contains six columns: "Name", "E-Mail", "Valid From", "Valid Until", "Details", and "Key-ID". There are no example values.'>
</div>

</div>

</div>
<br class="figure-break"><p>
        Next, add the MySQL Release Engineering certificate. Do this by
        clicking <span class="guimenu">File</span>, <span class="guimenu">Lookup Certificates
        on Server</span>. Type "Mysql Release Engineering" into the
        search box and press <span class="guibutton">Search</span>.
</p>
<div class="figure">
<a name="gnupg-kleopatra-find-certificate"></a><p class="title"><b>Figure 2.2 Kleopatra: Lookup Certificates on Server Wizard: Finding a Certificate</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/gnupg-kleopatra-find-certificate.png" width="854" height="330" alt='Shows a search input field titled "Find" with "mysql release engineering" entered. The one result contains the following values: Name=MySQL Release Engineering, E-Mail=mysql-build@oss.oracle.com, Valid From=2003-02-03, Valid Until="", Details=OpenPGP, Fingerprint=5072E1F5, and Key-ID=5072E1F5. Available action buttons are: Search, Select All, Deselect All, Details, Import, and Close.'>
</div>

</div>

</div>
<br class="figure-break"><p>
        Select the "MySQL Release Engineering" certificate. The
        Fingerprint and Key-ID must be "5072E1F5", or choose
        <span class="guibutton">Details...</span> to confirm the certificate is
        valid. Now, import it by clicking <span class="guibutton">Import</span>.
        An import dialog will be displayed, choose
        <span class="guibutton">Okay</span>, and this certificate will now be
        listed under the <span class="guilabel">Imported Certificates</span> tab.
      </p><p>
        Next, configure the trust level for our certificate. Select our
        certificate, then from the main menu select
        <span class="guimenu">Certificates</span>, <span class="guimenu">Change Owner
        Trust...</span>. We suggest choosing <span class="guilabel">I believe
        checks are very accurate</span> for our certificate, as
        otherwise you might not be able to verify our signature. Select
        <span class="guilabel">I believe checks are very accurate</span> to
        enable "full trust" and then press <span class="guibutton">OK</span>.
</p>
<div class="figure">
<a name="gnupg-kleopatra-change-trust"></a><p class="title"><b>Figure 2.3 Kleopatra: Change Trust level for MySQL Release Engineering</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/gnupg-kleopatra-change-trust.png" width="656" height="472" alt="A list of trust options are displayed, the options include &quot;I don't know (unknown trust)&quot;, &quot;I do NOT trust them (never trust)&quot;, &quot;I believe checks are casual (marginal trust)&quot;, &quot;I believe checks are very accurate (full trust)&quot;, and &quot;This is my certificate (ultimate trust)&quot;. The &quot;I believe checks are very accurate (full trust)&quot; option is selected.">
</div>

</div>

</div>
<br class="figure-break"><p>
        Next, verify the downloaded MySQL package file. This requires
        files for both the packaged file, and the signature. The
        signature file must have the same name as the packaged file but
        with an appended <code class="filename">.asc</code> extension, as shown
        by the example in the following table. The signature is linked
        to on the downloads page for each MySQL product. You must create
        the <code class="literal">.asc</code> file with this signature.
</p>
<div class="table">
<a name="idm139899660236816"></a><p class="title"><b>Table 2.2 MySQL Package and Signature Files for MySQL Installer for Microsoft
Windows</b></p>
<div class="table-contents">
<table><col width="25%"><col width="75%"><thead><tr>
            <th scope="col">File Type</th>
            <th scope="col">File Name</th>
          </tr></thead><tbody><tr>
            <td scope="row">Distribution file</td>
            <td><code class="literal">mysql-installer-community-8.0.13.msi</code></td>
          </tr><tr>
            <td scope="row">Signature file</td>
            <td><code class="literal">mysql-installer-community-8.0.13.msi.asc</code></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
        Make sure that both files are stored in the same directory and
        then run the following command to verify the signature for the
        distribution file. Either drag and drop the signature
        (<code class="filename">.asc</code>) file into Kleopatra, or load the
        dialog from <span class="guimenu">File</span>, <span class="guimenuitem">Decrypt/Verify
        Files...</span>, and then choose either the
        <code class="filename">.msi</code> or <code class="filename">.asc</code> file.
</p>
<div class="figure">
<a name="gnupg-kleopatra-decrypt-load"></a><p class="title"><b>Figure 2.4 Kleopatra: The Decrypt and Verify Files Dialog</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/gnupg-kleopatra-decrypt-load.png" width="576" height="425" alt="Shows available decrypt and verify options to perform. A MySQL Installer MSI file is used in the example where the .asc file is listed as &quot;Input file&quot; and the .msi file is listed under &quot;Signed Data&quot;. The &quot;Input file is detached signature&quot; option's checkbox is checked. A &quot;Input file is an archive; unpack with:&quot; option is shown but greyed out. Below is the &quot;Create all output files in a single folder&quot; option checkbox that is checked, and an &quot;Output folder&quot; input field with &quot;C:/docs&quot; entered as an example. The available buttons are &quot;Back&quot; (greyed out), &quot;Decrypt/Verify&quot;, and &quot;Cancel.&quot;">
</div>

</div>

</div>
<br class="figure-break"><p>
        Click <span class="guibutton">Decrypt/Verify</span> to check the file.
        The two most common results will look like the following, and
        although the yellow warning looks problematic, the following
        means that the file check passed with success. You may now run
        this installer.
</p>
<div class="figure">
<a name="gnupg-kleopatra-decrypt-okay-sig"></a><p class="title"><b>Figure 2.5 Kleopatra: the Decrypt and Verify Results Dialog: All operations
completed</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/gnupg-kleopatra-decrypt-okay-sig.png" width="576" height="424" alt="Yellow portion of the results window shows &quot;Not enough information to check signature validity&quot; and &quot;The validity of the signature cannot be verified.&quot; Also shown is key information, such as the KeyID and email address, the key's sign on date, and also displays the name of the ASC file..">
</div>

</div>

</div>
<br class="figure-break"><p>
        Seeing a red "The signature is bad" error means the file is
        invalid. Do not execute the MSI file if you see this error.
</p>
<div class="figure">
<a name="gnupg-kleopatra-decrypt-invalid-sig"></a><p class="title"><b>Figure 2.6 Kleopatra: the Decrypt and Verify Results Dialog: Bad</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/gnupg-kleopatra-decrypt-invalid-sig.png" width="656" height="518" alt='Red portion of the results window shows "Invalid signature", "Signed with unknown certificate", "The signature is bad", and also displays the name of the ASC file.'>
</div>

</div>

</div>
<br class="figure-break"><p>
        The <a class="xref" href="installing.html#checking-gpg-signature" title="2.1.3.2 Signature Checking Using GnuPG">Section 2.1.3.2, “Signature Checking Using GnuPG”</a> section explains
        why you probably don't see a green <code class="literal">Good
        signature</code> result.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="checking-rpm-signature"></a>2.1.3.4 Signature Checking Using RPM</h4>

</div>

</div>

</div>
<p>
        For RPM packages, there is no separate signature. RPM packages
        have a built-in GPG signature and MD5 checksum. You can verify a
        package by running the following command:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpm --checksig <em class="replaceable"><code>package_name</code></em>.rpm</code></strong>
</pre><p>
        Example:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpm --checksig MySQL-server-8.0.13-0.linux_glibc2.5.i386.rpm</code></strong>
MySQL-server-8.0.13-0.linux_glibc2.5.i386.rpm: md5 gpg OK
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          If you are using RPM 4.1 and it complains about <code class="literal">(GPG)
          NOT OK (MISSING KEYS: GPG#5072e1f5)</code>, even though you
          have imported the MySQL public build key into your own GPG
          keyring, you need to import the key into the RPM keyring
          first. RPM 4.1 no longer uses your personal GPG keyring (or
          GPG itself). Rather, RPM maintains a separate keyring because
          it is a system-wide application and a user's GPG public
          keyring is a user-specific file. To import the MySQL public
          key into the RPM keyring, first obtain the key, then use
          <span class="command"><strong>rpm --import</strong></span> to import the key. For
          example:
</p>
</div>
<pre data-lang="terminal" class="programlisting">
shell&gt; gpg --export -a 5072e1f5 &gt; 5072e1f5.asc
shell&gt; rpm --import 5072e1f5.asc
</pre><p>
        Alternatively, <span class="command"><strong>rpm</strong></span> also supports loading the
        key directly from a URL, and you can use this manual page:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpm --import http://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html</code></strong>
</pre><p>
        If you need to obtain the MySQL public key, see
        <a class="xref" href="installing.html#checking-gpg-signature" title="2.1.3.2 Signature Checking Using GnuPG">Section 2.1.3.2, “Signature Checking Using GnuPG”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="installation-layouts"></a>2.1.4 Installation Layouts</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899660178144"></a><a class="indexterm" name="idm139899660177072"></a><a class="indexterm" name="idm139899660176000"></a><a class="indexterm" name="idm139899660174512"></a><p>
      The installation layout differs for different installation types
      (for example, native packages, binary tarballs, and source
      tarballs), which can lead to confusion when managing different
      systems or using different installation sources. The individual
      layouts are given in the corresponding installation type or
      platform chapter, as described following. Note that the layout of
      installations from vendors other than Oracle may differ from these
      layouts.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="xref" href="installing.html#windows-installation-layout" title="2.3.1 MySQL Installation Layout on Microsoft Windows">Section 2.3.1, “MySQL Installation Layout on Microsoft Windows”</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#source-installation-layout" title="2.9.1 MySQL Layout for Source Installation">Section 2.9.1, “MySQL Layout for Source Installation”</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#binary-installation-layout" title="Table 2.3 MySQL Installation Layout for Generic Unix/Linux Binary Package">Table 2.3, “MySQL Installation Layout for Generic Unix/Linux Binary Package”</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#mysql-installation-layout-linuxrpm" title="Table 2.11 MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone">Table 2.11, “MySQL Installation Layout for Linux RPM Packages from the MySQL
        Developer Zone”</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#mysql-installation-layout-osx" title="Table 2.6 MySQL Installation Layout on macOS">Table 2.6, “MySQL Installation Layout on macOS”</a>
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="compiler-characteristics"></a>2.1.5 Compiler-Specific Build Characteristics</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899660162928"></a><p>
      In some cases, the compiler used to build MySQL affects the
      features available for use. The notes in this section apply for
      binary distributions provided by Oracle Corporation or that you
      compile yourself from source.
    </p><p>
      <span class="bold"><strong><span class="command"><strong>icc</strong></span> (Intel C++ Compiler)
      Builds</strong></span>
    </p><p>
      A server built with <span class="command"><strong>icc</strong></span> has these
      characteristics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          SSL support is not included.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="binary-installation"></a>2.2 Installing MySQL on Unix/Linux Using Generic Binaries</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm139899660155504"></a><a class="indexterm" name="idm139899660154048"></a><p>
    Oracle provides a set of binary distributions of MySQL. These
    include generic binary distributions in the form of compressed
    <span class="command"><strong>tar</strong></span> files (files with a
    <code class="filename">.tar.gz</code> extension) for a number of platforms,
    and binaries in platform-specific package formats for selected
    platforms.
  </p><p>
    This section covers the installation of MySQL from a compressed
    <span class="command"><strong>tar</strong></span> file binary distribution on Unix/Linux
    platforms. For other platform-specific binary package formats, see
    the other platform-specific sections in this manual. For example,
    for Windows distributions, see
    <a class="xref" href="installing.html#windows-installation" title="2.3 Installing MySQL on Microsoft Windows">Section 2.3, “Installing MySQL on Microsoft Windows”</a>. See
    <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a> on how to obtain MySQL in different
    distribution formats.
  </p><p>
    MySQL compressed <span class="command"><strong>tar</strong></span> file binary distributions
    have names of the form
    <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-<em class="replaceable"><code>OS</code></em>.tar.gz</code>,
    where <code class="literal"><em class="replaceable"><code>VERSION</code></em></code> is a
    number (for example, <code class="literal">8.0.13</code>), and
    <em class="replaceable"><code>OS</code></em> indicates the type of operating system
    for which the distribution is intended (for example,
    <code class="literal">pc-linux-i686</code> or <code class="literal">winx64</code>).
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warnings
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If you have previously installed MySQL using your operating
          system native package management system, such as Yum or APT,
          you may experience problems installing using a native binary.
          Make sure your previous MySQL installation has been removed
          entirely (using your package management system), and that any
          additional files, such as old versions of your data files,
          have also been removed. You should also check for
          configuration files such as <code class="filename">/etc/my.cnf</code>
          or the <code class="filename">/etc/mysql</code> directory and delete
          them.
        </p><p>
          For information about replacing third-party packages with
          official MySQL packages, see the related
          <a class="ulink" href="http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/" target="_top">APT
          guide</a> or <a class="ulink" href="http://dev.mysql.com/doc/refman/5.7/en/replace-third-party-yum.html" target="_top">Yum
          guide</a>.
        </p></li><li class="listitem"><a class="indexterm" name="idm139899660135376"></a><p>
          MySQL has a dependency on the <code class="literal">libaio</code>
          library. Data directory initialization and subsequent server
          startup steps will fail if this library is not installed
          locally. If necessary, install it using the appropriate
          package manager. For example, on Yum-based systems:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <em class="replaceable"><code>yum search libaio</code></em>  # search for info
shell&gt; <em class="replaceable"><code>yum install libaio</code></em> # install library
</pre><p>
          Or, on APT-based systems:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <em class="replaceable"><code>apt-cache search libaio</code></em> # search for info
shell&gt; <em class="replaceable"><code>apt-get install libaio1</code></em> # install library
</pre></li></ul>
</div>

</div>
<p>
    To install a compressed <span class="command"><strong>tar</strong></span> file binary
    distribution, unpack it at the installation location you choose
    (typically <code class="filename">/usr/local/mysql</code>). This creates the
    directories shown in the following table.
</p>
<div class="table">
<a name="binary-installation-layout"></a><p class="title"><b>Table 2.3 MySQL Installation Layout for Generic Unix/Linux Binary Package</b></p>
<div class="table-contents">
<table><col width="45%"><col width="55%"><thead><tr>
        <th scope="col">Directory</th>
        <th scope="col">Contents of Directory</th>
      </tr></thead><tbody><tr>
        <td scope="row"><code class="filename">bin</code></td>
        <td><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server, client and utility programs</td>
      </tr><tr>
        <td scope="row"><code class="filename">docs</code></td>
        <td>MySQL manual in Info format</td>
      </tr><tr>
        <td scope="row"><code class="filename">man</code></td>
        <td>Unix manual pages</td>
      </tr><tr>
        <td scope="row"><code class="filename">include</code></td>
        <td>Include (header) files</td>
      </tr><tr>
        <td scope="row"><code class="filename">lib</code></td>
        <td>Libraries</td>
      </tr><tr>
        <td scope="row"><code class="filename">share</code></td>
        <td>Error messages, dictionary, and SQL for database installation</td>
      </tr><tr>
        <td scope="row"><code class="literal">support-files</code></td>
        <td>Miscellaneous support files</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
    Debug versions of the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> binary are available
    as <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld-debug</strong></span></a>. To compile your own debug
    version of MySQL from a source distribution, use the appropriate
    configuration options to enable debugging support. See
    <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
  </p><a class="indexterm" name="idm139899660095552"></a><p>
    To install and use a MySQL binary distribution, the command sequence
    looks like this:
  </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>groupadd mysql</code></strong>
shell&gt; <strong class="userinput"><code>useradd -r -g mysql -s /bin/false mysql</code></strong>
shell&gt; <strong class="userinput"><code>cd /usr/local</code></strong>
shell&gt; <strong class="userinput"><code>tar zxvf <em class="replaceable"><code>/path/to/mysql-VERSION-OS</code></em>.tar.gz</code></strong>
shell&gt; <strong class="userinput"><code>ln -s <em class="replaceable"><code>full-path-to-mysql-VERSION-OS</code></em> mysql</code></strong>
shell&gt; <strong class="userinput"><code>cd mysql</code></strong>
shell&gt; <strong class="userinput"><code>mkdir mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>chown mysql:mysql mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>chmod 750 mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqld --initialize --user=mysql</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysql_ssl_rsa_setup</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqld_safe --user=mysql &amp;</code></strong>
# Next command is optional
shell&gt; <strong class="userinput"><code>cp support-files/mysql.server /etc/init.d/mysql.server</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      This procedure assumes that you have <code class="literal">root</code>
      (administrator) access to your system. Alternatively, you can
      prefix each command using the <span class="command"><strong>sudo</strong></span> (Linux) or
      <span class="command"><strong>pfexec</strong></span> (Solaris) command.
</p>
</div>
<p>
    The <code class="filename">mysql-files</code> directory provides a convenient
    location to use as the value for the
    <code class="literal">secure_file_priv</code> system variable, which limits
    import and export operations to a specific directory. See
    <a class="xref" href="server-administration.html#server-system-variables" title="5.1.5 Server System Variables">Section 5.1.5, “Server System Variables”</a>.
  </p><p>
    A more detailed version of the preceding description for installing
    a binary distribution follows.
</p>
<h3><a name="binary-installation-createsysuser"></a>Create a mysql User and Group</h3>
<p>
    If your system does not already have a user and group to use for
    running <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, you may need to create them. The
    following commands add the <code class="literal">mysql</code> group and the
    <code class="literal">mysql</code> user. You might want to call the user and
    group something else instead of <code class="literal">mysql</code>. If so,
    substitute the appropriate name in the following instructions. The
    syntax for <span class="command"><strong>useradd</strong></span> and
    <span class="command"><strong>groupadd</strong></span> may differ slightly on different
    versions of Unix/Linux, or they may have different names such as
    <span class="command"><strong>adduser</strong></span> and <span class="command"><strong>addgroup</strong></span>.
  </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>groupadd mysql</code></strong>
shell&gt; <strong class="userinput"><code>useradd -r -g mysql -s /bin/false mysql</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      Because the user is required only for ownership purposes, not
      login purposes, the <span class="command"><strong>useradd</strong></span> command uses the
      <code class="option">-r</code> and <code class="option">-s /bin/false</code> options to
      create a user that does not have login permissions to your server
      host. Omit these options if your <span class="command"><strong>useradd</strong></span> does
      not support them.
</p>
</div>
<h3><a name="binary-installation-unpack"></a>Obtain and Unpack the Distribution</h3>
<p>
    Pick the directory under which you want to unpack the distribution
    and change location into it. The example here unpacks the
    distribution under <code class="filename">/usr/local</code>. The
    instructions, therefore, assume that you have permission to create
    files and directories in <code class="filename">/usr/local</code>. If that
    directory is protected, you must perform the installation as
    <code class="literal">root</code>.
  </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cd /usr/local</code></strong>
</pre><p>
    Obtain a distribution file using the instructions in
    <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>. For a given release, binary
    distributions for all platforms are built from the same MySQL source
    distribution.
  </p><p>
    Unpack the distribution, which creates the installation directory.
    <span class="command"><strong>tar</strong></span> can uncompress and unpack the distribution if
    it has <code class="literal">z</code> option support:
  </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>tar zxvf <em class="replaceable"><code>/path/to/mysql-VERSION-OS</code></em>.tar.gz</code></strong>
</pre><p>
    The <span class="command"><strong>tar</strong></span> command creates a directory named
    <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-<em class="replaceable"><code>OS</code></em></code>.
  </p><p>
    To install MySQL from a compressed <span class="command"><strong>tar</strong></span> file
    binary distribution, your system must have GNU
    <code class="literal">gunzip</code> to uncompress the distribution and a
    reasonable <span class="command"><strong>tar</strong></span> to unpack it. If your
    <span class="command"><strong>tar</strong></span> program supports the <code class="literal">z</code>
    option, it can both uncompress and unpack the file.
  </p><p>
    GNU <span class="command"><strong>tar</strong></span> is known to work. The standard
    <span class="command"><strong>tar</strong></span> provided with some operating systems is not
    able to unpack the long file names in the MySQL distribution. You
    should download and install GNU <span class="command"><strong>tar</strong></span>, or if
    available, use a preinstalled version of GNU tar. Usually this is
    available as <span class="command"><strong>gnutar</strong></span>, <span class="command"><strong>gtar</strong></span>, or
    as <span class="command"><strong>tar</strong></span> within a GNU or Free Software directory,
    such as <code class="filename">/usr/sfw/bin</code> or
    <code class="filename">/usr/local/bin</code>. GNU <span class="command"><strong>tar</strong></span> is
    available from <a class="ulink" href="http://www.gnu.org/software/tar/" target="_top">http://www.gnu.org/software/tar/</a>.
  </p><p>
    If your <span class="command"><strong>tar</strong></span> does not have <code class="literal">z</code>
    option support, use <span class="command"><strong>gunzip</strong></span> to unpack the
    distribution and <span class="command"><strong>tar</strong></span> to unpack it. Replace the
    preceding <span class="command"><strong>tar</strong></span> command with the following
    alternative command to uncompress and extract the distribution:
  </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gunzip &lt; <em class="replaceable"><code>/path/to/mysql-VERSION-OS</code></em>.tar.gz | tar xvf -</code></strong>
</pre><p>
    Next, create a symbolic link to the installation directory created
    by <span class="command"><strong>tar</strong></span>:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>ln -s <em class="replaceable"><code>full-path-to-mysql-VERSION-OS</code></em> mysql</code></strong>
</pre><p>
  </p><p>
    The <code class="literal">ln</code> command makes a symbolic link to the
    installation directory. This enables you to refer more easily to it
    as <code class="filename">/usr/local/mysql</code>. To avoid having to type
    the path name of client programs always when you are working with
    MySQL, you can add the <code class="filename">/usr/local/mysql/bin</code>
    directory to your <code class="literal">PATH</code> variable:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>export PATH=$PATH:/usr/local/mysql/bin</code></strong>
</pre><p>
</p>
<h3><a name="binary-installation-postinstall"></a>Perform Postinstallation Setup</h3>
<p>
    The remainder of the installation process involves setting
    distribution ownership and access permissions, initializing the data
    directory, starting the MySQL server, and setting up the
    configuration file. For instructions, see
    <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="windows-installation"></a>2.3 Installing MySQL on Microsoft Windows</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#windows-installation-layout">2.3.1 MySQL Installation Layout on Microsoft Windows</a></span></dt><dt><span class="section"><a href="installing.html#windows-choosing-package">2.3.2 Choosing an Installation Package</a></span></dt><dt><span class="section"><a href="installing.html#mysql-installer">2.3.3 MySQL Installer for Windows</a></span></dt><dt><span class="section"><a href="installing.html#windows-notifier">2.3.4 MySQL Notifier</a></span></dt><dt><span class="section"><a href="installing.html#windows-install-archive">2.3.5 Installing MySQL on Microsoft Windows Using a
<code class="literal">noinstall</code> ZIP Archive</a></span></dt><dt><span class="section"><a href="installing.html#windows-troubleshooting">2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation</a></span></dt><dt><span class="section"><a href="installing.html#windows-postinstallation">2.3.7 Windows Postinstallation Procedures</a></span></dt><dt><span class="section"><a href="installing.html#windows-upgrading">2.3.8 Upgrading MySQL on Windows</a></span></dt><dt><span class="section"><a href="installing.html#deploy-mysql-nonlinux-docker">2.3.9 Deploying MySQL on Windows and Other Non-Linux Platforms</a></span></dt></dl>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
      MySQL 8.0 Server requires the Microsoft Visual C++
      2015 Redistributable Package to run on Windows platforms. Users
      should make sure the package has been installed on the system
      before installing the server. The package is available at the
      <a class="ulink" href="http://www.microsoft.com/en-us/download/default.aspx" target="_top">Microsoft
      Download Center</a>. Additionally, MySQL debug binaries
      require Visual Studio 2015 to be installed.
</p>
</div>
<p>
    MySQL is available for Microsoft Windows, for both 32-bit and 64-bit
    versions. For supported Windows platform information, see
    <a class="ulink" href="http://www.mysql.com/support/supportedplatforms/database.html" target="_top">http://www.mysql.com/support/supportedplatforms/database.html</a>.
  </p><p>
    There are different methods to install MySQL on Microsoft Windows.
</p>
<h3><a name="idm139899660014960"></a>MySQL Installer Method</h3>
<p>
    The simplest and recommended method is to download MySQL Installer (for
    Windows) and let it install and configure all of the MySQL products
    on your system. Here is how:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
        Download MySQL Installer from <a class="ulink" href="http://dev.mysql.com/downloads/installer/" target="_top">http://dev.mysql.com/downloads/installer/</a>
        and execute it.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Unlike the standard MySQL Installer, the smaller "web-community" version
          does not bundle any MySQL applications but it will download
          the MySQL products you choose to install.
</p>
</div>
</li><li class="listitem"><p>
        Choose the appropriate <span class="guilabel">Setup Type</span> for your
        system. Typically you will choose <span class="guilabel">Developer
        Default</span> to install MySQL server and other MySQL tools
        related to MySQL development, helpful tools like MySQL Workbench.
        Or, choose the <span class="guilabel">Custom</span> setup type to
        manually select your desired MySQL products.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Multiple versions of MySQL server can exist on a single
          system. You can choose one or multiple versions.
</p>
</div>
</li><li class="listitem"><p>
        Complete the installation process by following the instructions.
        This will install several MySQL products and start the MySQL
        server.
</p></li></ol>
</div>
<p>
    MySQL is now installed. If you configured MySQL as a service, then
    Windows will automatically start MySQL server every time you restart
    your system.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      You probably also installed other helpful MySQL products like
      MySQL Workbench and MySQL Notifier on your system. Consider loading
      <a class="xref" href="workbench.html" title="Chapter 30 MySQL Workbench">Chapter 30, <i>MySQL Workbench</i></a> to check your new MySQL server
      connection, and <a class="xref" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">Section 2.3.4, “MySQL Notifier”</a> to view the
      connection's status. By default, these two programs automatically
      start after installing MySQL.
</p>
</div>
<p>
    This process also installs the MySQL Installer application on your system, and
    later you can use MySQL Installer to upgrade or reconfigure your MySQL
    products.
</p>
<h3><a name="idm139899660001680"></a>Additional Installation Information</h3>
<p>
    It is possible to run MySQL as a standard application or as a
    Windows service. By using a service, you can monitor and control the
    operation of the server through the standard Windows service
    management tools. For more information, see
    <a class="xref" href="installing.html#windows-start-service" title="2.3.5.8 Starting MySQL as a Windows Service">Section 2.3.5.8, “Starting MySQL as a Windows Service”</a>.
  </p><p>
    Generally, you should install MySQL on Windows using an account that
    has administrator rights. Otherwise, you may encounter problems with
    certain operations such as editing the <code class="literal">PATH</code>
    environment variable or accessing the <span class="command"><strong>Service Control
    Manager</strong></span>. When installed, MySQL does not need to be
    executed using a user with Administrator privileges.
  </p><p>
    For a list of limitations on the use of MySQL on the Windows
    platform, see <a class="xref" href="restrictions.html#limits-windows" title="C.10.5 Windows Platform Limitations">Section C.10.5, “Windows Platform Limitations”</a>.
  </p><p>
    In addition to the MySQL Server package, you may need or want
    additional components to use MySQL with your application or
    development environment. These include, but are not limited to:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        To connect to the MySQL server using ODBC, you must have a
        Connector/ODBC driver. For more information, including
        installation and configuration instructions, see
        <a class="ulink" href="http://dev.mysql.com/doc/connector-odbc/en/" target="_top">MySQL Connector/ODBC Developer Guide</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          MySQL Installer will install and configure Connector/ODBC for you.
</p>
</div>
</li><li class="listitem"><p>
        To use MySQL server with .NET applications, you must have the
        Connector/Net driver. For more information, including
        installation and configuration instructions, see
        <a class="ulink" href="http://dev.mysql.com/doc/connector-net/en/" target="_top">MySQL Connector/Net Developer Guide</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          MySQL Installer will install and configure MySQL Connector/Net for you.
</p>
</div>
</li></ul>
</div>
<p>
    MySQL distributions for Windows can be downloaded from
    <a class="ulink" href="http://dev.mysql.com/downloads/" target="_top">http://dev.mysql.com/downloads/</a>. See
    <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>.
  </p><p>
    MySQL for Windows is available in several distribution formats,
    detailed here. Generally speaking, you should use MySQL Installer. It contains
    more features and MySQL products than the older MSI, is simpler to
    use than the compressed file, and you need no additional tools to
    get MySQL up and running. MySQL Installer automatically installs MySQL Server
    and additional MySQL products, creates an options file, starts the
    server, and enables you to create default user accounts. For more
    information on choosing a package, see
    <a class="xref" href="installing.html#windows-choosing-package" title="2.3.2 Choosing an Installation Package">Section 2.3.2, “Choosing an Installation Package”</a>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        A MySQL Installer distribution includes MySQL Server and additional MySQL
        products including MySQL Workbench, MySQL Notifier, and MySQL
        for Excel. MySQL Installer can also be used to upgrade these products in
        the future.
      </p><p>
        For instructions on installing MySQL using MySQL Installer, see
        <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>.
      </p></li><li class="listitem"><p>
        The standard binary distribution (packaged as a compressed file)
        contains all of the necessary files that you unpack into your
        chosen location. This package contains all of the files in the
        full Windows MSI Installer package, but does not include an
        installation program.
      </p><p>
        For instructions on installing MySQL using the compressed file,
        see <a class="xref" href="installing.html#windows-install-archive" title="2.3.5 Installing MySQL on Microsoft Windows Using a noinstall ZIP Archive">Section 2.3.5, “Installing MySQL on Microsoft Windows Using a
      <code class="literal">noinstall</code> ZIP Archive”</a>.
      </p></li><li class="listitem"><p>
        The source distribution format contains all the code and support
        files for building the executables using the Visual Studio
        compiler system.
      </p><p>
        For instructions on building MySQL from source on Windows, see
        <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
</p></li></ul>
</div>
<h3><a name="idm139899659979216"></a>MySQL on Windows Considerations</h3>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        <span class="bold"><strong>Large Table Support</strong></span>
      </p><p>
        If you need tables with a size larger than 4GB, install MySQL on
        an NTFS or newer file system. Do not forget to use
        <code class="literal">MAX_ROWS</code> and
        <code class="literal">AVG_ROW_LENGTH</code> when you create tables. See
        <a class="xref" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax">Section 13.1.18, “CREATE TABLE Syntax”</a>.
      </p></li><li class="listitem"><p>
        <span class="bold"><strong>MySQL and Virus Checking
        Software</strong></span>
      </p><p>
        Virus-scanning software such as Norton/Symantec Anti-Virus on
        directories containing MySQL data and temporary tables can cause
        issues, both in terms of the performance of MySQL and the
        virus-scanning software misidentifying the contents of the files
        as containing spam. This is due to the fingerprinting mechanism
        used by the virus-scanning software, and the way in which MySQL
        rapidly updates different files, which may be identified as a
        potential security risk.
      </p><p>
        After installing MySQL Server, it is recommended that you
        disable virus scanning on the main directory
        (<a class="link" href="server-administration.html#sysvar_datadir"><code class="literal">datadir</code></a>) used to store your
        MySQL table data. There is usually a system built into the
        virus-scanning software to enable specific directories to be
        ignored.
      </p><p>
        In addition, by default, MySQL creates temporary files in the
        standard Windows temporary directory. To prevent the temporary
        files also being scanned, configure a separate temporary
        directory for MySQL temporary files and add this directory to
        the virus scanning exclusion list. To do this, add a
        configuration option for the
        <a class="link" href="server-administration.html#option_mysqld_tmpdir"><code class="option">tmpdir</code></a> parameter to your
        <code class="filename">my.ini</code> configuration file. For more
        information, see <a class="xref" href="installing.html#windows-create-option-file" title="2.3.5.2 Creating an Option File">Section 2.3.5.2, “Creating an Option File”</a>.
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-installation-layout"></a>2.3.1 MySQL Installation Layout on Microsoft Windows</h3>

</div>

</div>

</div>
<p>
      For MySQL 8.0 on Windows, the default installation
      directory is <code class="filename">C:\Program Files\MySQL\MySQL Server
      8.0</code> for installations performed with MySQL Installer.
      If you use the ZIP archive method to install MySQL, you may prefer
      to install in <code class="filename">C:\mysql</code>. However, the layout
      of the subdirectories remains the same.
    </p><p>
      All of the files are located within this parent directory, using
      the structure shown in the following table.
</p>
<div class="table">
<a name="idm139899659962064"></a><p class="title"><b>Table 2.4 Default MySQL Installation Layout for Microsoft Windows</b></p>
<div class="table-contents">
<table><col width="30%"><col width="40%"><col width="30%"><thead><tr>
          <th scope="col">Directory</th>
          <th scope="col">Contents of Directory</th>
          <th scope="col">Notes</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="filename">bin</code></td>
          <td><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server, client and utility programs</td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="filename">%PROGRAMDATA%\MySQL\MySQL Server 8.0\</code></td>
          <td>Log files, databases</td>
          <td>The Windows system variable <code class="varname">%PROGRAMDATA%</code> defaults to
            <code class="filename">C:\ProgramData</code>.</td>
        </tr><tr>
          <td scope="row"><code class="filename">docs</code></td>
          <td>Release documentation</td>
          <td>With MySQL Installer, use the <code class="literal">Modify</code> operation to select this
            optional folder.</td>
        </tr><tr>
          <td scope="row"><code class="filename">include</code></td>
          <td>Include (header) files</td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="filename">lib</code></td>
          <td>Libraries</td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="filename">share</code></td>
          <td>Miscellaneous support files, including error messages, character set
            files, sample configuration files, SQL for database
            installation</td>
          <td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-choosing-package"></a>2.3.2 Choosing an Installation Package</h3>

</div>

</div>

</div>
<p>
      For MySQL 8.0, there are multiple installation
      package formats to choose from when installing MySQL on Windows.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        Program Database (PDB) files (with file name extension
        <code class="filename">pdb</code>) provide information for debugging your
        MySQL installation in the event of a problem. These files are
        included in ZIP Archive distributions (but not MSI
        distributions) of MySQL.
</p>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <span class="bold"><strong>MySQL Installer</strong></span>: This package has a file
          name similar to
          <code class="filename">mysql-installer-community-8.0.13.0.msi</code>
          or
          <code class="filename">mysql-installer-commercial-8.0.13.0.msi</code>,
          and utilizes MSIs to automatically install MySQL server and
          other products. It will download and apply updates to itself,
          and for each of the installed products. It also configures the
          installed MySQL server (including InnoDB Cluster Sandbox test
          setups) and MySQL Router.
        </p><p>
          MySQL Installer can install and manage (add, modify, upgrade, and remove)
          many other MySQL products, including:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              Applications – MySQL Workbench, MySQL for Visual Studio, MySQL Notifier,
              MySQL for Excel, MySQL Utilities, MySQL Shell, MySQL Router
            </p></li><li class="listitem"><p>
              Connectors – MySQL Connector/C, MySQL Connector/C++, MySQL Connector/Net, Connector/ODBC,
              MySQL Connector/Python, MySQL Connector/J, MySQL Connector/Node.js
            </p></li><li class="listitem"><p>
              Documentation – MySQL Manual (PDF format), samples
              and examples
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
            MySQL Installer does not include debugging binaries/information
            components (including PDB files). These are available in a
            separate ZIP archive named
            <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-winx64-debug-test.zip</code>
            for 64-bit and
            <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-win32-debug-test.zip</code>
            for 32-bit.
</p>
</div>
<p>
          MySQL Installer operates on all MySQL supported versions of Windows (see
          <a class="ulink" href="http://www.mysql.com/support/supportedplatforms/database.html" target="_top">http://www.mysql.com/support/supportedplatforms/database.html</a>).
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Because MySQL Installer is not a native component of Microsoft Windows
            and depends on .NET, it will not work on minimal
            installation options like the "Server Core" version of
            Windows Server 2008.
</p>
</div>
<p>
          For instructions on installing MySQL using MySQL Installer, see
          <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>The <code class="literal">noinstall</code> ZIP
          Archives</strong></span>: These packages contain the files found in
          the complete installation package, with the exception of the
          GUI. This format does not include an automated installer, and
          must be manually installed and configured.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            The <code class="literal">noinstall</code> ZIP archives are split into
            two separate compressed files. The main package is named
            <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-winx64.zip</code>
            for 64-bit and
            <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-win32.zip</code>
            for 32-bit. This contains the components needed to use MySQL
            on your system. The optional MySQL test suite, MySQL
            benchmark suite, and debugging binaries/information
            components (including PDB files) are in a separate
            compressed file named
            <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-winx64-debug-test.zip</code>
            for 64-bit and
            <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>-win32-debug-test.zip</code>
            for 32-bit.
</p>
</div>
</li></ul>
</div>
<p>
      MySQL Installer is recommended for most users.
    </p><p>
      Your choice of install package affects the installation process
      you must follow. If you choose to use MySQL Installer, see
      <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>. If you choose to install a
      <code class="literal">noinstall</code> ZIP archive, see
      <a class="xref" href="installing.html#windows-install-archive" title="2.3.5 Installing MySQL on Microsoft Windows Using a noinstall ZIP Archive">Section 2.3.5, “Installing MySQL on Microsoft Windows Using a
      <code class="literal">noinstall</code> ZIP Archive”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-installer"></a>2.3.3 MySQL Installer for Windows</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#mysql-installer-setup">2.3.3.1 MySQL Installer Initial Setup</a></span></dt><dt><span class="section"><a href="installing.html#mysql-installer-workflow">2.3.3.2 Installation Workflow with MySQL Installer</a></span></dt><dt><span class="section"><a href="installing.html#mysql-installer-catalog-dashboard">2.3.3.3 MySQL Installer Product Catalog and Dashboard</a></span></dt><dt><span class="section"><a href="installing.html#MySQLInstallerConsole">2.3.3.4 MySQLInstallerConsole Reference</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899659897760"></a><p>
    MySQL Installer is a standalone application designed to ease the complexity of
    installing and managing MySQL products that run on Microsoft
    Windows. It supports the following MySQL products:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        MySQL Servers
      </p><p>
        MySQL Installer can install and manage multiple, separate MySQL server
        instances on the same host at the same time. For example, MySQL Installer
        can install, configure, and upgrade a separate instance of MySQL
        5.6, MySQL 5.7, and MySQL 8.0 on the same host. MySQL Installer does not
        permit server upgrades between major and minor version numbers,
        but does permit upgrades within a release series (such as 5.7.18
        to 5.7.19).
      </p><p>
        A host <span class="emphasis"><em>cannot</em></span> have both community and
        commercial editions of MySQL server installed.
      </p></li><li class="listitem"><p>
        MySQL Applications
      </p><p>
        MySQL Workbench, MySQL Shell, MySQL Router, MySQL for Visual Studio, MySQL for Excel,
        MySQL Notifier, and MySQL Utilities.
      </p></li><li class="listitem"><p>
        MySQL Connectors
      </p><p>
        MySQL Connector/Net, MySQL Connector/Python, MySQL Connector/Node.js MySQL Connector/ODBC, MySQL Connector/J, MySQL Connector/C, and MySQL Connector/C++.
      </p></li><li class="listitem"><p>
        Documentation and Samples
      </p><p>
        MySQL Reference Manuals (by version) in PDF format and MySQL
        database samples (by version).
</p></li></ul>
</div>
<h4><a name="mysql-installer-requiremetns"></a>Installation Requirements</h4>
<p>
    MySQL Installer requires Microsoft .NET Framework 4.5.2 or later. If this
    version is not installed on the host computer, you can download it
    by visiting the
    <a class="ulink" href="https://www.microsoft.com/en-us/download/details.aspx?id=42643" target="_top">Microsoft
    web site</a>.
</p>
<h4><a name="mysql-installer-community-edition"></a>MySQL Installer Community Edition</h4>
<p>
    Download this edition from
    <a class="ulink" href="http://dev.mysql.com/downloads/installer/" target="_top">http://dev.mysql.com/downloads/installer/</a> to install the
    community version of all MySQL products for Windows. Select one of
    the following MySQL Installer package options:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        <span class="emphasis"><em>Web:</em></span> Contains MySQL Installer and configuration files
        only. The web package downloads only the MySQL products you
        select to install, but it requires an internet connection for
        each download. The size of this file is approximately 2 MB; the
        name of the file has the form
        <code class="filename">mysql-installer-community-<code class="literal">web</code>-<em class="replaceable"><code>VERSION</code></em>.<em class="replaceable"><code>N</code></em>.msi</code>
        where <code class="literal">VERSION</code> is the MySQL server version
        number such as 8.0 and
        <code class="literal">N</code> is the package number, which begins at 0.
      </p></li><li class="listitem"><p>
        <span class="emphasis"><em>Full:</em></span> Bundles all of the MySQL products for
        Windows (including the MySQL server). The file size is over 300
        MB, and its name has the form
        <code class="filename">mysql-installer-community-<em class="replaceable"><code>VERSION</code></em>.<em class="replaceable"><code>N</code></em>.msi</code>
        where <code class="literal">VERSION</code> is the MySQL Server version
        number such as 8.0 and
        <code class="literal">N</code> is the package number, which begins at 0.
</p></li></ul>
</div>
<h4><a name="mysql-installer-commercial-edition"></a>MySQL Installer Commercial Edition</h4>
<p>
    Download this edition from
    <a class="ulink" href="https://edelivery.oracle.com/" target="_top">https://edelivery.oracle.com/</a> to install the
    commercial edition of all MySQL products for Windows. The Commercial
    Edition includes all of the products in the Community Edition and
    also includes the following products:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        Workbench SE/EE
      </p></li><li class="listitem"><p>
        MySQL Enterprise Backup
      </p></li><li class="listitem"><p>
        MySQL Enterprise Firewall
</p></li></ul>
</div>
<p>
    This edition integrates with your My Oracle Support (MOS) account.
    For knowledge-base content and patches, see
    <a class="ulink" href="https://support.oracle.com/" target="_top">My Oracle Support</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-installer-setup"></a>2.3.3.1 MySQL Installer Initial Setup</h4>

</div>

</div>

</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#setup-license" title="MySQL Installer Licensing and Support Authentication">MySQL Installer Licensing and Support Authentication</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#setup-type" title="Choosing a Setup Type">Choosing a Setup Type</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#setup-conflicts" title="Path Conflicts">Path Conflicts</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#setup-requirements" title="Check Requirements">Check Requirements</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#setup-layout" title="MySQL Installer Configuration Files">MySQL Installer Configuration Files</a></p></li></ul>
</div>
<p>
      When you download MySQL Installer for the first time, a setup wizard guides
      you through the initial installation of MySQL products. As the
      following figure shows, the initial setup is a one-time activity
      in the overall process. MySQL Installer detects existing MySQL
      products installed on the host during its initial setup and adds
      them to the list of products to be managed.
</p>
<div class="figure">
<a name="mysql-installer-overview-fig"></a><p class="title"><b>Figure 2.7 MySQL Installer Process Overview</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-process-overview.png" width="722" height="171" alt="MySQL Installer process. Non-repeating steps: download MySQL Installer; perform the initial setup. Repeating steps: install products (download products, run MSI files, configuration, and install complete); manage products and update the MySQL Installer catalog.">
</div>

</div>

</div>
<br class="figure-break"><p>
      MySQL Installer extracts configuration files (described later) to the hard
      drive of the host during the initial setup. Although MySQL Installer is a
      32-bit application, it can install both 32-bit and 64-bit
      binaries.
    </p><p>
      The initial setup adds a link to the Start menu under the
      <span class="guimenu">MySQL</span> group. Click <span class="guimenu">Start</span>,
      <span class="guimenu">All Programs</span>, <span class="guimenu">MySQL</span>,
      <span class="guimenu">MySQL Installer</span> to open MySQL Installer.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="setup-license"></a>MySQL Installer Licensing and Support Authentication</h5>
</div>
</div>
</div>
<p>
        MySQL Installer requires you to accept the license agreement before it will
        install new MySQL packages. After you accept the terms of the
        agreement, you can add, update, reconfigure, and remove all of
        the products and features provided by the MySQL Installer edition you
        downloaded.
      </p><p>
        For the commercial edition, entering your My Oracle Support
        (MOS) credentials is optional when installing bundled MySQL
        products, but your credentials are required when choosing
        unbundled MySQL products that MySQL Installer must download. An unbundled
        product is any MSI file that you download using MySQL Installer after the
        initial setup. Your credentials must match the user name and
        password that you have registered with Oracle for access to the
        support site.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="setup-type"></a>Choosing a Setup Type</h5>

</div>

</div>

</div>
<p>
        During the initial setup, you are prompted to select the MySQL
        products to be installed on the host. One alternative is to use
        a predetermined setup type that matches your setup requirements.
        By default, both GA and pre-release products are included in the
        download and installation with the <span class="guilabel">Developer
        Default</span>, <span class="guilabel">Client only</span>, and
        <span class="guilabel">Full</span> setup types. Select the <span class="guilabel">Only
        install GA products</span> option to restrict the product
        set to include GA products only when using these setup types.
      </p><p>
        Choosing one of the following setup types determines the initial
        installation only and does not limit your ability to install or
        update MySQL products for Windows later:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="guilabel">Developer Default</span>: Install the
            following products that compliment application development
            with MySQL:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <a class="ulink" href="http://dev.mysql.com/doc/" target="_top">MySQL
                Server</a> (Installs the version that you selected
                when you downloaded MySQL Installer.)
              </p></li><li class="listitem"><p>
                <a class="link" href="mysql-shell.html" title="Chapter 19 MySQL Shell User Guide">MySQL Shell</a>
              </p></li><li class="listitem"><p>
                <a class="ulink" href="http://dev.mysql.com/doc/mysql-router/8.0/en/" target="_top">MySQL Router</a>
              </p></li><li class="listitem"><p>
                <a class="link" href="workbench.html" title="Chapter 30 MySQL Workbench">MySQL Workbench</a>
              </p></li><li class="listitem"><p>
                <a class="ulink" href="http://dev.mysql.com/doc/visual-studio/en/" target="_top">MySQL for Visual Studio</a>
              </p></li><li class="listitem"><p>
                <a class="ulink" href="http://dev.mysql.com/doc/mysql-for-excel/en/" target="_top">MySQL for Excel</a>
              </p></li><li class="listitem"><p>
                <a class="link" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">MySQL Notifier</a>
              </p></li><li class="listitem"><p>
                <a class="ulink" href="http://dev.mysql.com/doc/index-connectors.html" target="_top">MySQL
                Connectors</a> (.NET / Python / ODBC / Java / C /
                C++)
              </p></li><li class="listitem"><p>
                <a class="ulink" href="http://dev.mysql.com/doc/mysql-utilities/1.6/en/" target="_top">MySQL Utilities</a>
              </p></li><li class="listitem"><p>
                MySQL Documentation
              </p></li><li class="listitem"><p>
                MySQL Samples and Examples
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <span class="bold"><strong>Server only</strong></span>: Only install
            the MySQL server. This setup type installs the general
            availability (GA) or development release server that you
            selected when you downloaded MySQL Installer. It uses the default
            installation and data paths.
          </p></li><li class="listitem"><p>
            <span class="bold"><strong>Client only</strong></span>: Only install
            the most recent MySQL applications and MySQL connectors.
            This setup type is similar to the <code class="literal">Developer
            Default</code> type, except that it does not include
            MySQL server or the client programs typically bundled with
            the server, such as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> or
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>.
          </p></li><li class="listitem"><p>
            <span class="bold"><strong>Full</strong></span>: Install all available
            MySQL products.
          </p></li><li class="listitem"><p>
            <span class="bold"><strong>Custom</strong></span> The custom setup
            type enables you to filter and select individual MySQL
            products from the
            <a class="link" href="installing.html#windows-product-catalog" title="Product Catalog">MySQL Installer catalog</a>.

            
          </p><p>
            Use the <code class="literal">Custom</code> setup type to install:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                A product or product version that is not available from
                the usual download locations. The catalog contains all
                product releases, including the other releases between
                pre-release (or development) and GA.
              </p></li><li class="listitem"><p>
                An instance of MySQL server using an alternative
                installation path, data path, or both. For instructions
                on how to adjust the paths, see
                <a class="xref" href="installing.html#mysql-installer-change-path-proc" title="2.3.3.2.3 Setting Alternative Server Paths with MySQL Installer">Section 2.3.3.2.3, “Setting Alternative Server Paths with MySQL Installer”</a>.
              </p></li><li class="listitem"><p>
                Two or more MySQL server versions on the same host at
                the same time (for example, 5.6, 5.7, and 8.0).
              </p></li><li class="listitem"><p>
                A specific combination of products and features not
                offered as a predetermine setup type. For example, you
                can install a single product, such as MySQL Workbench,
                instead of installing all client applications for
                Windows.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="setup-conflicts"></a>Path Conflicts</h5>

</div>

</div>

</div>
<p>
        When the default installation or data folder (required by MySQL
        server) for a product to be installed already exists on the
        host, the wizard displays the <span class="guilabel">Path Conflict</span>
        step to identify each conflict and enable you to take action to
        avoid having files in the existing folder overwritten by the new
        installation. You see this step in the initial setup only when
        MySQL Installer detects a conflict.
      </p><p>
        To resolve the path conflict, do one of the following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Select a product from the list to display the conflict
            options. A warning symbol indicates which path is in
            conflict. Use the browse button to choose a new path and
            then click <span class="guibutton">Next</span>.
          </p></li><li class="listitem"><p>
            Click <span class="guibutton">Back</span> to choose a different
            setup type or product version, if applicable. The
            <code class="literal">Custom</code> setup type enables you to select
            individual product versions.
          </p></li><li class="listitem"><p>
            Click <span class="guibutton">Next</span> to ignore the conflict and
            overwrite files in the existing folder.
          </p></li><li class="listitem"><p>
            Delete the existing product. Click
            <span class="guibutton">Cancel</span> to stop the initial setup and
            close MySQL Installer. Open MySQL Installer again from the Start menu and delete
            the installed product from the host using the Delete
            operation from the dashboard.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="setup-requirements"></a>Check Requirements</h5>

</div>

</div>

</div>
<p>
        MySQL Installer uses entries in the <code class="filename">package-rules.xml</code>
        file to determine whether the prerequisite software for each
        product is installed on the host. When the requirements check
        fails, MySQL Installer displays the <span class="guilabel">Check Requirements</span>
        step to help you update the host. The following figure
        identifies and describes the key areas of this step.
</p>
<div class="figure">
<a name="mysql-installer-requirements-fig"></a><p class="title"><b>Figure 2.8 Check Requirements</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-requirements-annotated.png" width="594" height="387" alt="MySQL Installer check-requirements screen before any requirements are downloaded and installed.">
</div>

</div>

</div>
<br class="figure-break"><h6><a name="setup-requirements-elements"></a>Description of Check Requirements Elements</h6>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Shows the current step in the initial setup. Steps in this
            list may change slightly depending on the products already
            installed on the host, the availability of prerequisite
            software, and the products to be installed on the host.
          </p></li><li class="listitem"><p>
            Lists all pending installation requirements by product and
            indicates the status as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                A blank space in the <span class="guilabel">Status</span> column
                means that MySQL Installer can attempt to download and install the
                required software for you.
              </p></li><li class="listitem"><p>
                The word <span class="emphasis"><em>Manual</em></span> in the
                <span class="guilabel">Status</span> column means that you must
                satisfy the requirement manually. Select each product in
                the list to see its requirement details.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            Describes the requirement in detail to assist you with each
            manual resolution. When possible, a download URL is
            provided. After you download and install the required
            software, click <span class="guibutton">Check</span> to verify that
            the requirement has been met.
          </p></li><li class="listitem"><p>
            Provides the following set operations to proceed:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <span class="guibutton">Back</span> – Return to the
                previous step. This action enables you to select a
                different the setup type.
              </p></li><li class="listitem"><p>
                <span class="guibutton">Execute</span> – Have MySQL Installer attempt
                to download and install the required software for all
                items without a manual status. Manual requirements are
                resolved by you and verified by clicking
                <span class="guibutton">Check</span>.
              </p></li><li class="listitem"><p>
                <span class="guibutton">Next</span> – Do not execute the
                request to apply the requirements automatically and
                proceed to the installation without including the
                products that fail the check requirements step.
              </p></li><li class="listitem"><p>
                <span class="guibutton">Cancel</span> – Stop the
                installation of MySQL products. Because MySQL Installer is already
                installed, the initial setup begins again when you open
                MySQL Installer from the Start menu and click
                <span class="guibutton">Add</span> from the dashboard. For a
                description of the available management operations, see
                <a class="xref" href="installing.html#windows-product-catalog" title="Product Catalog">Product Catalog</a>.
</p></li></ul>
</div>
</li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="setup-layout"></a>MySQL Installer Configuration Files</h5>

</div>

</div>

</div>
<p>
        All MySQL Installer files are located within the <code class="filename">C:\Program Files
        (x86)</code> and <code class="filename">C:\ProgramData</code>
        folders. The following table describes the files and folders
        that define MySQL Installer as a standalone application.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Installed MySQL products are neither altered nor removed when
          you update or uninstall MySQL Installer.
</p>
</div>

<div class="table">
<a name="idm139899659755856"></a><p class="title"><b>Table 2.5 MySQL Installer Configuration Files</b></p>
<div class="table-contents">
<table><col width="30%"><col width="40%"><col width="30%"><thead><tr>
            <th scope="col">File or Folder</th>
            <th scope="col">Description</th>
            <th scope="col">Folder Hierarchy</th>
          </tr></thead><tbody><tr>
            <td scope="row"><code class="filename">MySQL Installer for Windows</code></td>
            <td>This folder contains all of the files needed to run MySQL Installer and
              <a class="link" href="installing.html#MySQLInstallerConsole" title="2.3.3.4 MySQLInstallerConsole Reference">MySQLInstallerConsole.exe</a>,
              a command-line program with similar functionality.</td>
            <td><code class="filename">C:\Program Files (x86)</code></td>
          </tr><tr>
            <td scope="row"><code class="filename">Templates</code></td>
            <td>The <code class="filename">Templates</code> folder has one file for each version
              of MySQL server. Template files contain keys and formulas
              to calculate some values dynamically.</td>
            <td><code class="filename">C:\ProgramData\MySQL\MySQL Installer for
              Windows\Manifest</code></td>
          </tr><tr>
            <td scope="row"><code class="filename">package-rules.xml</code></td>
            <td><p>
                This file contains the prerequisites for every product
                to be installed.
              </p></td>
            <td><code class="filename">C:\ProgramData\MySQL\MySQL Installer for
              Windows\Manifest</code></td>
          </tr><tr>
            <td scope="row"><code class="filename">produts.xml</code></td>
            <td><p>
                The <code class="filename">products</code> file (or product
                catalog) contains a list of all products available for
                download.
              </p></td>
            <td><code class="filename">C:\ProgramData\MySQL\MySQL Installer for
              Windows\Manifest</code></td>
          </tr><tr>
            <td scope="row"><code class="filename">Product Cache</code></td>
            <td><p>
                The <code class="filename">Product Cache</code> folder contains
                all standalone MSI files bundled with the full package
                or downloaded afterward.
              </p></td>
            <td><code class="filename">C:\ProgramData\MySQL\MySQL Installer for Windows</code></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-installer-workflow"></a>2.3.3.2 Installation Workflow with MySQL Installer</h4>

</div>

</div>

</div>
<p>
      MySQL Installer provides a wizard-like tool to install and configure new
      MySQL products for Windows. Unlike the initial setup, which runs
      only once, MySQL Installer invokes the wizard each time you download or
      install a new product. For first-time installations, the steps of
      the initial setup proceed directly into the steps of the
      installation.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        Full permissions are granted to the user executing MySQL Installer to all
        generated files, such as <code class="filename">my.ini</code>. This does
        not apply to files and directories for specific products, such
        as the MySQL server data directory in
        <code class="literal">%ProgramData%</code> that is owned by
        <code class="literal">SYSTEM</code>.
</p>
</div>
<p>
      Products installed and configured on a host follow a general
      pattern that might require your input during the various steps.
      MySQL Installer loads all selected products together using the following
      workflow:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Product download. If you installed the full (not web) MySQL Installer
          package, all MSI files were loaded to the <code class="filename">Product
          Cache</code> folder during the initial setup and are not
          downloaded again. Otherwise, the status of each product
          changes from <code class="literal">Downloading</code> to
          <code class="literal">Downloaded</code>.
        </p></li><li class="listitem"><p>
          Product installation. The status of each product in the list
          changes from <code class="literal">Ready to Install</code> to
          <code class="literal">Installing</code> to <code class="literal">Complete</code>.
          During the process, click <span class="guilabel">Show Details</span> to
          view the installation actions.
        </p><p>
          If you cancel the installation at this point, the products are
          installed, but the server (if installed) is not yet
          configured. To restart the server configuration, open MySQL Installer
          from the Start menu and click the
          <span class="guilabel">Reconfigure</span> link next to the appropriate
          server in the dashboard.
        </p></li><li class="listitem"><p>
          Product configuration. This step applies to MySQL server and
          samples in most cases. The status for each item in the list
          should indicate, <code class="literal">Ready to Configure</code>. Click
          <span class="guibutton">Next</span> to begin the step-by-step
          configuration of all items in the list.
        </p><p>
          The configuration options presented during this step depend on
          which version of the database you selected to install. After
          the installation completes, you can reconfigure MySQL server
          from the MySQL Installer dashboard.
        </p></li><li class="listitem"><p>
          Installation compete. This step finalizes the installation and
          enables you to start some applications when the installation
          finishes.
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name="mysql-installer-workflow-innodb-cluster"></a>2.3.3.2.1 Group Replication</h5>

</div>

</div>

</div>
<p>
        You have two options to implement a high-availability solution
        when you install MySQL 5.7.17 or higher (64-bit) using MySQL Installer:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Standalone MySQL Server / Classic MySQL Replication
            (default)
          </p><p>
            Select this option to begin the initial configuration of a
            standalone MySQL server. You can configure multiple servers
            with classic MySQL Replication manually or use MySQL Shell
            1.0.9 or higher to configure a production InnoDB cluster.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              Existing instance ports (3310 to 3390) set for a sandbox
              InnoDB cluster that was created manually using
              MySQL Shell, will be deleted by MySQL Installer if you
              later run the sandbox InnoDB cluster test setup.
</p>
</div>
<p>
            For a description of the server configuration options that
            apply to a standalone MySQL server on Windows, see
            <a class="xref" href="installing.html#mysql-installer-workflow-server" title="2.3.3.2.2 Server Configuration with MySQL Installer">Section 2.3.3.2.2, “Server Configuration with MySQL Installer”</a>.
          </p></li><li class="listitem"><p>
            Sandbox InnoDB Cluster Test Setup (for testing only)
          </p><p>
            Select this option to create and configure sandbox
            InnoDB cluster instances locally for testing. You can
            configure a sandbox InnoDB cluster to have three, five,
            seven, or nine MySQL server instances. Use the
            <span class="guilabel">Reconfigure</span> quick action in the MySQL Installer
            toolbar to adjust the number of instances in the
            InnoDB cluster after the configuration has finished.
          </p><p>
            As the following figure shows, this step requires that you
            enter a password for the MySQL root account. The password
            strength is evaluated when you retype it.
</p>
<div class="figure">
<a name="mysql-installer-innodb-cluster-instances"></a><p class="title"><b>Figure 2.9 Sandbox InnoDB cluster Test Setup</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-group-replication.png" width="741" height="560" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"></li></ul>
</div>
<p>
        The sandbox InnoDB cluster, named
        <code class="literal">sandboxCluster</code> by default, is available on
        selected ports. After the configuration executes, click the
        <span class="guilabel">Summary</span> tab to view the specific ports that
        apply to your cluster. Sandbox InnoDB cluster configuration
        entries are stored in the
        <code class="filename">installer_config.xml</code> file.
      </p><p>
        You can use MySQL Installer to install MySQL Shell 1.0.9 or later, if it
        is not installed. MySQL Shell enables you to manage the
        sandbox instances. To connect with the MySQL Shell on port
        3310, execute the following command:
      </p><pre class="programlisting">
shell&gt; <strong class="userinput"><code>mysqlsh root@localhost:3310</code></strong>
</pre><p>
        MySQL Installer also provides a wizard for configuring MySQL Router to connect
        to the test InnoDB cluster that was created in this step. For
        configuration details, see
        <a class="xref" href="installing.html#windows-applications-router" title="MySQL Router Configuration">MySQL Router Configuration</a>. To learn more
        about MySQL Router operations, see
        <a class="ulink" href="http://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-innodb-cluster.html" target="_top">Routing for MySQL InnoDB cluster</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name="mysql-installer-workflow-server"></a>2.3.3.2.2 Server Configuration with MySQL Installer</h5>

</div>

</div>

</div>
<p>
        MySQL Installer handles the initial configuration of the MySQL server. For
        example:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            It creates the configuration file
            (<code class="filename">my.ini</code>) that is used to configure the
            MySQL server. The values written to this file are influenced
            by choices you make during the installation process. Some
            definitions are host dependent. For example, query_cache is
            enabled if the host has fewer than three cores.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              Query cache was deprecated in MySQL 5.7 and removed in
              MySQL 8.0 (and later).
</p>
</div>
</li><li class="listitem"><p>
            By default, a Windows service for the MySQL server is added.
          </p></li><li class="listitem"><p>
            Provides default installation and data paths for MySQL
            server. For instructions on how to change the default paths,
            see <a class="xref" href="installing.html#mysql-installer-change-path-proc" title="2.3.3.2.3 Setting Alternative Server Paths with MySQL Installer">Section 2.3.3.2.3, “Setting Alternative Server Paths with MySQL Installer”</a>.
          </p></li><li class="listitem"><p>
            It can optionally create MySQL server user accounts with
            configurable permissions based on general roles, such as DB
            Administrator, DB Designer, and Backup Admin. It optionally
            creates a Windows user named <code class="literal">MysqlSys</code>
            with limited privileges, which would then run the MySQL
            Server.
          </p><p>
            User accounts may also be added and configured in
            MySQL Workbench.
          </p></li><li class="listitem"><p>
            Checking <span class="guilabel">Show Advanced Options</span> allows
            additional <span class="guilabel">Logging Options</span> to be set.
            This includes defining custom file paths for the error log,
            general log, slow query log (including the configuration of
            seconds it requires to execute a query), and the binary log.
</p></li></ul>
</div>
<p>
        During the configuration process, click
        <span class="guibutton">Next</span> to proceed to the next step or
        <span class="guibutton">Back</span> to return to the previous step.
        Click <span class="guibutton">Execute</span> at the final step to apply
        the server configuration.
      </p><p>
        The sections that follow describe the server configuration
        options that apply to MySQL server on Windows. The server
        version you installed will determine which steps and options you
        can configure. Configuring MySQL server may include some or all
        of the following steps:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#server-type-network" title="Type and Networking">Type and Networking</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#server-authentication-method" title="Authentication Method">Authentication Method</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#server-accounts-roles" title="Accounts and Roles">Accounts and Roles</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#server-windows-service" title="Windows Service">Windows Service</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#server-plugins-and-extensions" title="Plugins and Extensions">Plugins and Extensions</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#server-advanced-options" title="Advanced Options">Advanced Options</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#server-apply-config" title="Apply Server Configuration">Apply Server Configuration</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h6 class="title"><a name="server-type-network"></a>Type and Networking</h6>
</div>

</div>

</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Server Configuration Type
            </p><p>
              Choose the MySQL server configuration type that describes
              your setup. This setting defines the amount of system
              resources (memory) that will be assigned to your MySQL
              server instance.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <span class="bold"><strong>Development</strong></span>: A
                  machine that will host many other applications, and
                  typically this is your personal workstation. This
                  option configures MySQL to use the least amount of
                  memory.
                </p></li><li class="listitem"><p>
                  <span class="bold"><strong>Server</strong></span>: Several other
                  applications will be running on this machine, such as
                  a web server. This option configures MySQL to use a
                  medium amount of memory.
                </p></li><li class="listitem"><p>
                  <span class="bold"><strong>Dedicated</strong></span>: A machine
                  that is dedicated to running the MySQL server. Because
                  no other major applications will run on this server,
                  such as a web server, this option configures MySQL to
                  use the majority of available memory.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              Connectivity
            </p><p>
              Connectivity options control how the connection to MySQL
              is made. Options include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <span class="guilabel">TCP/IP</span>: You may enable TCP/IP
                  Networking here as otherwise only local host
                  connections are allowed. Also define the
                  <span class="guilabel">Port Number</span> and whether to open
                  the firewall port for network access. If the port
                  number is in use already, you will see the information
                  icon (<span class="inlinemediaobject"><img src="images/mi-info-symbol.png" align="middle" width="22" height="20"></span>) next to the default value and
                  <span class="guibutton">Next</span> is disabled until you
                  provide a new port number.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Named Pipe</span>: Enable and define the
                  pipe name, similar to using the
                  <code class="literal">--enable-named-pipe</code> option.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Shared Memory</span>: Enable and then
                  define the memory name, similar to using the
                  <code class="literal">--shared-memory</code> option.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              Advanced Configuration
            </p><p>
              Check <span class="guilabel">Show Advanced Options</span> to set
              additional logging options in a later step. This includes
              defining custom file paths for the error log, general log,
              slow query log (including the configuration of seconds it
              requires to execute a query), and the binary log.
            </p></li><li class="listitem"><p>
              MySQL Enterprise Firewall (Commercial Edition only)
            </p><p>
              The <span class="guilabel">Enable Enterprise Firewall</span> check
              box is selected by default. For post-installation
              instructions, see <a class="xref" href="security.html#firewall" title="6.5.6 MySQL Enterprise Firewall">Section 6.5.6, “MySQL Enterprise Firewall”</a>.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h6 class="title"><a name="server-authentication-method"></a>Authentication Method</h6>
</div>

</div>

</div>
<p>
          The <span class="guilabel">Authentication Method</span> step is visible
          only during the installation or upgrade of MySQL 8.0.4 or
          higher. It introduces a choice between two server-side
          authentication options. The MySQL user accounts that you
          create in the next step will use the authentication method
          that you select in this step.
        </p><p>
          MySQL 8.0 connectors and community drivers that use
          <code class="literal">libmysqlclient</code> 8.0 now support the
          <code class="literal">mysql_native_password</code> default
          authentication plugin. However, if you are unable to update
          your clients and applications to support this new
          authentication method, you can configure the MySQL server to
          use <code class="literal">mysql_native_password</code> for legacy
          authentication. For more information about the implications of
          this change, see
          <a class="xref" href="installing.html#upgrade-caching-sha2-password" title="caching_sha2_password as the Preferred Authentication Plugin">caching_sha2_password as the Preferred Authentication Plugin</a>.
        </p><p>
          If you are installing or upgrading to MySQL 8.0.4 or higher,
          select one of the following authentication methods:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Use Strong Password Encryption for Authentication
              (RECOMMENDED)
            </p><p>
              MySQL 8.0 supports a new authentication based on improved,
              stronger SHA256-based password methods. It is recommended
              that all new MySQL server installations use this method
              going forward.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
                The <code class="literal">caching_sha2_password</code>
                authentication plugin on the server requires new
                versions of connectors and clients, which add support
                for the new MySQL 8.0 default authentication.
</p>
</div>
</li><li class="listitem"><p>
              Use Legacy Authentication Method (Retain MySQL 5.x
              Compatibility)
            </p><p>
              Using the old MySQL 5.x legacy authentication method
              should be considered only in the following cases:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  Applications cannot be updated to use MySQL 8.0
                  connectors and drivers.
                </p></li><li class="listitem"><p>
                  Recompilation of an existing application is not
                  feasible.
                </p></li><li class="listitem"><p>
                  An updated, language-specific connector or driver is
                  not available yet.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h6 class="title"><a name="server-accounts-roles"></a>Accounts and Roles</h6>
</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Root Account Password
            </p><p>
              Assigning a root password is required and you will be
              asked for it when performing other MySQL Installer operations.
              Password strength is evaluated when you repeat the
              password in the box provided. For descriptive information
              regarding password requirements or status, move your mouse
              pointer over the information icon (<span class="inlinemediaobject"><img src="images/mi-info-symbol.png" align="middle" width="22" height="20"></span>) when it appears.
            </p></li><li class="listitem"><p>
              MySQL User Accounts
            </p><p>
              Optionally, you can create additional MySQL user accounts
              with predefined user roles. Each predefined role, such as
              DB Admin, are configured with their own set of privileges.
              For example, the DB Admin role has more privileges than
              the DB Designer role. Click the <span class="guilabel">Role</span>
              drop-down list for a description of each role.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                If the MySQL server is installed, then you must also
                enter the current root password.
</p>
</div>
</li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h6 class="title"><a name="server-windows-service"></a>Windows Service</h6>
</div>

</div>

</div>
<p>
          On the Windows platform, MySQL server can run as a named
          service managed by the operating system and be configured to
          start up automatically when Windows starts. Alternatively, you
          can configure MySQL server to run as an executable program
          that requires manual configuration.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <span class="guilabel">Configure MySQL server as a Windows
              service</span> (Selected by default.)
            </p><p>
              When the default configuration option is selected, you can
              also select the following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <span class="guilabel">Start the MySQL Server at System
                  Startup</span>
                </p><p>
                  When selected (default), the service startup type is
                  set to Automatic; otherwise, the startup type is set
                  to Manual.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Run Windows Service as</span>
                </p><p>
                  When <span class="guilabel">Standard System Account</span> is
                  selected (default), the service logs on as Network
                  Service.
                </p><p>
                  The <span class="guilabel">Custom User</span> option must have
                  privileges to log on to Microsoft Windows as a
                  service. The <span class="guibutton">Next</span> button will
                  be disabled until this user is configured with the
                  required privileges.
                </p><p>
                  A custom user is configured in Windows by searching
                  for "local security policy" in the Start menu. In the
                  Local Security Policy window, select <span class="guilabel">Local
                  Policies</span>, <span class="guilabel">User Rights
                  Assignment</span>, and then <span class="guilabel">Log On As A
                  Service</span> to open the property dialog. Click
                  <span class="guibutton">Add User or Group</span> to add the
                  custom user and then click <span class="guibutton">OK</span>
                  in each dialog to save the changes.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              Deselect the Windows Service option
            </p><p>
              
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h6 class="title"><a name="server-plugins-and-extensions"></a>Plugins and Extensions</h6>
</div>

</div>

</div>
<p>
          The <span class="guilabel">Plugins and Extensions</span> step is
          visible during a new installation of MySQL 5.7.12 (or higher)
          only. If you are upgrading from a previous MySQL version, then
          you need to open MySQL Installer again and select the
          <span class="guilabel">Reconfigure</span> MySQL server option.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <span class="guilabel">Enable X Protocol / MySQL as a Document
              Store</span> (Selected by default.)
            </p><p>
              When the X Protocol option is selected, MySQL Installer loads
              and starts the X Plugin. Without the X Plugin
              running, X Protocol clients cannot connect to the
              server.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <span class="guilabel">Port Number:</span>
                  <em class="replaceable"><code>33060</code></em>
                </p><p>
                  Requires an unused port. The default port number is
                  33060.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Open Firewall port for network
                  access</span>
                </p><p>
                  Open by default when the X Protocol is selected.
</p></li></ul>
</div>
<p>
              For more information about using MySQL as a document store
              and the X Plugin, see
              <a class="xref" href="document-store.html#document-store-concepts" title="20.1 Key Concepts">Section 20.1, “Key Concepts”</a> and
              <a class="xref" href="document-store.html#x-plugin" title="20.6 X Plugin">Section 20.6, “X Plugin”</a>.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h6 class="title"><a name="server-advanced-options"></a>Advanced Options</h6>
</div>

</div>

</div>
<p>
          This step is available if the <span class="guilabel">Show Advanced
          Configuration</span> check box was selected during the
          <span class="guilabel">Type and Networking</span> step. To enable this
          step now, click <span class="guibutton">Back</span> to return to the
          <span class="guilabel">Type and Networking</span> step and select the
          check box.
        </p><p>
          Advanced configuration options are related to the following
          MySQL log files:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <a class="link" href="server-administration.html#error-log" title="5.4.2 The Error Log">Error log</a>
            </p></li><li class="listitem"><p>
              <a class="link" href="server-administration.html#query-log" title="5.4.3 The General Query Log">General log</a>
            </p></li><li class="listitem"><p>
              <a class="link" href="server-administration.html#slow-query-log" title="5.4.5 The Slow Query Log">Slow query log</a>
            </p></li><li class="listitem"><p>
              <a class="link" href="server-administration.html#binary-log" title="5.4.4 The Binary Log">Bin log</a>
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h6 class="title"><a name="server-apply-config"></a>Apply Server Configuration</h6>
</div>

</div>

</div>
<p>
          All configuration settings are applied to the MySQL server
          when you click <span class="guibutton">Execute</span>. Use the
          <span class="guilabel">Configuration Steps</span> tab to follow the
          progress of each action; the icon for each toggles from white
          to green (with a check mark) on success. Otherwise, the
          process stops and displays an error message if an individual
          action times out. Click the <span class="guilabel">Log</span> tab to
          view the log.
        </p><p>
          When the installation is done and you click
          <span class="guibutton">Finish</span>, MySQL Installer and the installed MySQL
          products are added to the Microsoft Windows Start menu under
          the <code class="literal">MySQL</code> group. Opening MySQL Installer loads the
          <a class="link" href="installing.html#windows-product-dashboard" title="MySQL Installer Dashboard">dashboard</a>
          where installed MySQL products are listed and other MySQL Installer
          operations are available.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name="mysql-installer-change-path-proc"></a>2.3.3.2.3 Setting Alternative Server Paths with MySQL Installer</h5>

</div>

</div>

</div>
<div class="procedure">
<p>
          You can change the default installation path, the data path,
          or both when you install MySQL server. After you have
          installed the server, the paths cannot be altered without
          removing and reinstalling the server instance.
        </p><p>
          <span class="bold"><strong>To change paths for MySQL
          server</strong></span>
        </p><ol class="procedure" type="1"><li class="step"><p>
            Identify the MySQL server to change and display the
            <span class="guilabel">Advanced Options</span> link.
          </p><ol type="a" class="substeps"><li class="step"><p>
                Navigate to the <span class="guilabel">Select Products and
                Features</span> step by doing one of the following:
              </p><ol type="i" class="substeps"><li class="step"><p>
                    If this is an
                    <a class="link" href="installing.html#mysql-installer-setup" title="2.3.3.1 MySQL Installer Initial Setup">initial
                    setup</a>, select the <code class="literal">Custom</code>
                    setup type and click <span class="guibutton">Next</span>.
                  </p></li><li class="step"><p>
                    If MySQL Installer is installed already, launch it from the
                    Start menu and then click <span class="guibutton">Add</span>
                    from the dashboard.
                  </p></li></ol></li><li class="step"><p>
                Click <span class="guibutton">Edit</span> to filter the list of
                products, locate the server instance to be installed in
                the <span class="guilabel">Available Products</span> list.
              </p></li><li class="step"><p>
                With the server instance selected, use the arrow to move
                the selected server to the <span class="guilabel">Products/Features
                To Be Installed</span> list.
              </p></li><li class="step"><p>
                Click the server to select it. When you select the
                server, the <span class="guilabel">Advanced Options</span> link
                appears. For details, see the figure that follows.
              </p></li></ol></li><li class="step"><p>
            Click <span class="guilabel">Advanced Options</span> to open a dialog
            window with the path-setting options. After setting the
            path, click <span class="guibutton">Next</span> to continue with the
            configuration steps.
</p>
<div class="figure">
<a name="mysql-installer-custom-path-fig"></a><p class="title"><b>Figure 2.10 Change MySQL Server Path</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-path-advanced-options.png" width="541" height="381" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"></li></ol>
</div>

</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h5 class="title"><a name="mysql-installer-workflow-nonserver-products"></a>2.3.3.2.4 MySQL Applications, Connectors, and Documentation</h5>

</div>

</div>

</div>
<p>
        MySQL Installer provides you with a suite of tools for developing and
        managing business-critical applications on Windows. The suite
        consist of applications, connectors, documentation, and samples.
      </p><p>
        During the <a class="link" href="installing.html#mysql-installer-setup" title="2.3.3.1 MySQL Installer Initial Setup">initial
        setup</a>, choose any predetermined setup type, except
        <code class="literal">Server only</code>, to install the latest GA version
        of the tools. Use the <code class="literal">Custom</code> setup type to
        install an individual tool or specific version. If MySQL Installer is
        installed on the host already, use the <span class="guilabel">Add</span>
        operation to select and install tools from the MySQL Installer dashboard.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h6 class="title"><a name="windows-applications-router"></a>MySQL Router Configuration</h6>
</div>

</div>

</div>
<p>
          MySQL Installer provides a configuration wizard that can bootstrap an
          installed instance of MySQL Router 2.1.3 or later to route traffic
          between MySQL applications and an InnoDB cluster. When
          configured, MySQL Router runs as a local Windows service. For
          detailed information about using MySQL Router with an
          InnoDB cluster, see
          <a class="ulink" href="http://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-innodb-cluster.html" target="_top">Routing for MySQL InnoDB cluster</a>.
        </p><p>
          To configure MySQL Router, do the following:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
              Set up InnoDB cluster. For instructions on how to
              configure a sandbox InnoDB cluster on the local host using
              MySQL Installer, see
              <a class="xref" href="installing.html#mysql-installer-workflow-innodb-cluster" title="2.3.3.2.1 Group Replication">Section 2.3.3.2.1, “Group Replication”</a>.
              InnoDB cluster requires MySQL Server 5.7.17 or higher.
            </p><p>
              For general InnoDB cluster information, see
              <a class="xref" href="mysql-innodb-cluster-userguide.html" title="Chapter 21 InnoDB Cluster">Chapter 21, <i>InnoDB Cluster</i></a>.
            </p></li><li class="listitem"><p>
              Using MySQL Installer, download and install the MySQL Router application.
              After the installation finishes, the configuration wizard
              prompts you for information. Select the
              <span class="guilabel">Configure MySQL Router for
              InnoDB cluster</span> check box to begin the
              configuration and provide the following configuration
              values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  <span class="guilabel">Hostname:</span> localhost by default.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Port:</span> The port number of the
                  primary server in the InnoDB cluster. The default is
                  3310.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Management User:</span> An
                  administrative user with root-level privileges.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Password:</span> The password for the
                  management user.
                </p></li><li class="listitem"><p>
                  <span class="guilabel">Classic MySQL protocol connections to
                  InnoDB cluster</span>
                </p><p>
                  <span class="guilabel">Read/Write:</span> Set the first base
                  port number to one that is unused (between 80 and
                  65532) and the wizard will select the remaining ports
                  for you.
                </p><p>
                  The figure that follows shows an example of the
                  MySQL Router configuration screen, with the first base
                  port number specified as 6446 and the remaining ports
                  set by the wizard as 6447, 6448, and 6449.
</p></li></ul>
</div>

<div class="figure">
<a name="mysql-installer-router-config"></a><p class="title"><b>Figure 2.11 MySQL Router Configuration</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-router-config.png" width="541" height="381" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"></li><li class="listitem"><p>
              Click <span class="guibutton">Next</span> and then
              <span class="guibutton">Execute</span> to apply the configuration.
              Click <span class="guibutton">Finish</span> to close MySQL Installer or
              return to the MySQL Installer dashboard.
</p></li></ol>
</div>

</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-installer-catalog-dashboard"></a>2.3.3.3 MySQL Installer Product Catalog and Dashboard</h4>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#windows-product-catalog" title="Product Catalog">Product Catalog</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#windows-product-dashboard" title="MySQL Installer Dashboard">MySQL Installer Dashboard</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#locate-products" title="Locating Products to Install">Locating Products to Install</a></p></li></ul>
</div>
<p>
      This section describes the MySQL Installer product catalog and the dashboard.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="windows-product-catalog"></a>Product Catalog</h5>
</div>
</div>
</div>
<p>
        The product catalog stores the complete list of released MySQL
        products for Microsoft Windows that are available to download
        from <a class="ulink" href="http://dev.mysql.com/downloads/" target="_top">MySQL Downloads</a>.
        By default, and when an Internet connection is present, MySQL Installer
        updates the catalog daily. You can also update the catalog
        manually from the dashboard (described later).
      </p><p>
        An up-to-date catalog performs the following actions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Populates the <span class="guilabel">Available Products</span> pane
            of the Select Products and Features step. This step appears
            when you select:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                The <code class="literal">Custom</code> setup type during the
                <a class="link" href="installing.html#mysql-installer-setup" title="2.3.3.1 MySQL Installer Initial Setup">initial
                setup</a>.
              </p></li><li class="listitem"><p>
                The <span class="guilabel">Add</span> operation from the
                dashboard.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            Identifies when product updates are available for the
            installed products listed in the dashboard.
</p></li></ul>
</div>
<p>
        The catalog includes all development releases (Pre-Release),
        general releases (Current GA), and minor releases (Other
        Releases). Products in the catalog will vary somewhat, depending
        on the MySQL Installer edition that you download.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="windows-product-dashboard"></a>MySQL Installer Dashboard</h5>

</div>

</div>

</div>
<p>
        The MySQL Installer dashboard is the default screen that you see when you
        start MySQL Installer after the
        <a class="link" href="installing.html#mysql-installer-setup" title="2.3.3.1 MySQL Installer Initial Setup">initial setup</a>
        finishes. If you closed MySQL Installer before the setup was finished, MySQL Installer
        resumes the initial setup before it displays the dashboard.
</p>
<div class="figure">
<a name="mysql-installer-dashboard-fig"></a><p class="title"><b>Figure 2.12 MySQL Installer Dashboard Elements</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-dashboard-annotated.png" width="571" height="396" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><h6><a name="windows-product-dashboard-elements"></a>Description of MySQL Installer Dashboard Elements</h6>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            The MySQL Installer-About icon (<span class="inlinemediaobject"><img src="images/mi-question-mark-button.png" align="middle" width="16" height="16"></span>) shows the current version of MySQL Installer and
            general information about MySQL. The version number is
            located above the <span class="guibutton">Back</span> button.
          </p><p>
            Always include this version number when reporting a problem
            with MySQL Installer.
          </p></li><li class="listitem"><p>
            The MySQL Installer Options icon (<span class="inlinemediaobject"><img src="images/mi-tool-button.png" align="middle" width="16" height="16"></span>) enables you to schedule daily
            automatic catalog updates. By default, catalog updates are
            scheduled at the hour when MySQL Installer was first installed. When
            new products or product versions are available, MySQL Installer adds
            them to the catalog and then displays an arrow icon
            (<span class="inlinemediaobject"><img src="images/wb-icon-upgrade-arrow.png" align="middle" width="16" height="16"></span>) next to the version number of
            installed products listed in the dashboard.
          </p><p>
            Use this option to enable or disable automatic catalog
            updates and to reset the time of day when the MySQL Installer updates
            the catalog automatically. For specific settings, see the
            task named <code class="literal">ManifestUpdate</code> in the Windows
            Task Scheduler.
          </p></li><li class="listitem"><p>
            MySQL Installer dashboard operations provide a variety of actions that
            apply to installed products or products listed in the
            catalog. To initiate the following operations, first click
            the operation link and then select the product or products
            to manage:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="mysql-installer-alter-add"></a>
                <span class="guilabel">Add</span>: This operation opens the
                Select Products and Features screen. From there, you can
                filter the product in the product catalog, select one or
                more products to download (as needed), and begin the
                installation. For hints about using the filter, see
                <a class="xref" href="installing.html#locate-products" title="Locating Products to Install">Locating Products to Install</a>.
              </p></li><li class="listitem"><p><a name="mysql-installer-alter-modify"></a>
                <span class="guilabel">Modify</span>: Use this operation to add
                or remove the features associated with installed
                products. Features that you can modify vary in
                complexity by product. When the <span class="guilabel">Program
                Shortcut</span> check box is selected, the product
                appears in the Start menu under the
                <code class="literal">MySQL</code> group.
              </p></li><li class="listitem"><p><a name="mysql-installer-alter-upgrade"></a>
                <span class="guilabel">Upgrade</span>: This operation loads the
                Select Products to Upgrade screen and populates it with
                all the upgrade candidates. An installed product can
                have more than one upgrade version and requires a
                current product catalog.
              </p><p>
                <span class="bold"><strong> Important server upgrade
                conditions:</strong></span>
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    MySQL Installer does not permit server upgrades
                    between major release versions or minor release
                    versions, but does permit upgrades within a release
                    series, such as an upgrade from 5.7.18 to 5.7.19.
                  </p></li><li class="listitem"><p>
                    Upgrades between milestone releases (or from a
                    milestone release to a GA release) are not
                    supported. Significant development changes take
                    place in milestone releases and you may encounter
                    compatibility issues or problems starting the
                    server.
</p></li></ul>
</div>
<p>
                To choose a new product version:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                    Click <span class="guilabel">Upgrade</span>. Confirm that the
                    check box next to product name in the
                    <span class="guilabel">Upgradeable Products</span> pane has a
                    check mark. Deselect the products that you do not
                    intend to upgrade at this time.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                      For server milestone releases in the same release
                      series, MySQL Installer deselects the server
                      upgrade and displays a warning to indicate that
                      the upgrade is not supported, identifies the risks
                      of continuing, and provides a summary of the steps
                      to perform a logical upgrade manually. You can
                      reselect server upgrade at your own risk. For
                      instructions on how to perform a logical upgrade
                      with a milestone release, see
                      <a class="ulink" href="http://dev.mysql.com/doc/refman/5.7/en/upgrading-strategies.html#upgrade-procedure-logical" target="_top">Logical Upgrade</a>.
</p>
</div>
</li><li class="listitem"><p>
                    Click a product in the list to highlight it. This
                    action populates the <span class="guilabel">Upgradeable
                    Versions</span> pane with the details of each
                    available version for the selected product: version
                    number, published date, and a
                    <code class="literal">Changes</code> link to open the release
                    notes for that version.
</p></li></ol>
</div>
<p>
                MySQL Installer upgrades all of the selected products in one
                action. Click <span class="guibutton">Show Details</span> to
                view the actions performed by MySQL Installer.
              </p></li><li class="listitem"><p><a name="mysql-installer-remove"></a>
                <span class="guilabel">Remove</span> This operation opens the
                Remove Products screen and populates it with the MySQL
                products installed on the host. Select the MySQL
                products you want to remove (uninstall) and then click
                <span class="guibutton">Execute</span> to begin the removal
                process.
              </p><p>
                To select products to remove, do one of the following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    Select the check box for one or more products.
                  </p></li><li class="listitem"><p>
                    Select the <span class="guilabel">Product</span> check box to
                    select all products.
</p></li></ul>
</div>
</li></ul>
</div>
</li><li class="listitem"><p><a name="mysql-installer-alter-reconfigure"></a>
            The <span class="guilabel">Reconfigure</span> link in the Quick
            Action column next to each installed server loads the
            current configuration values for the server and then cycles
            through all configuration steps enabling you to change the
            options and values. On completion, MySQL Installer stops the server,
            applies the configuration changes, and restarts the server
            for you. For a description of each configuration option, see
            <a class="xref" href="installing.html#mysql-installer-workflow-server" title="2.3.3.2.2 Server Configuration with MySQL Installer">Section 2.3.3.2.2, “Server Configuration with MySQL Installer”</a>.
          </p><p>
            Installed <code class="literal">Samples and Examples</code> associated
            with a specific MySQL server version can be also be
            reconfigured to apply feature-configuration changes, if any.
            You must provide credentials with root privileges to
            reconfigure these items.
          </p><p>
            
          </p></li><li class="listitem"><p><a name="mysql-installer-catalog"></a>
            The <span class="guilabel">Catalog</span> link enables you to
            download the latest catalog of MySQL products manually and
            then to integrate those product changes with MySQL Installer. The
            catalog-download action does not perform an upgrade of the
            products already installed on the host. Instead, it returns
            to the dashboard and displays an arrow icon in the Version
            column for each installed product that has a newer version.
            Use the <span class="guilabel">Upgrade</span> operation to install
            the newer product version.
          </p><p>
            You can also use the <span class="guilabel">Catalog</span> link to
            display the current change history of each product without
            downloading the new catalog. Select the <span class="guilabel">Do not
            update at this time</span> check box to view the change
            history only.
</p></li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="locate-products"></a>Locating Products to Install</h5>

</div>

</div>

</div>
<p>
        MySQL products in the catalog are listed by category: MySQL
        Servers, Applications, MySQL Connectors, and Documentation. Only
        the latest GA versions appear in the <span class="guilabel">Available
        Products</span> pane by default. If you are looking for a
        pre-release or older version of a product, it may not be visible
        in the default list.
      </p><p>
        To change the default product list, click
        <span class="guilabel">Add</span> on the dashboard to open the Select
        Products and Features screen, and then click
        <span class="guibutton">Edit</span>. Modify the product values and then
        click <span class="guibutton">Filter</span>.
</p>
<div class="figure">
<a name="mysql-installer-product-filter-fig"></a><p class="title"><b>Figure 2.13 Filter Available Products</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mi-product-filter.png" width="456" height="249" alt="Filter by Text, Category, Age, Already Downloaded, and Architecture.">
</div>

</div>

</div>
<br class="figure-break"><p>
        Reset one or more of the following values to filter the list of
        available products:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Text: Filter by text.
          </p></li><li class="listitem"><p>
            Category: All Software (default), MySQL Servers,
            Applications, MySQL Connectors, or Documentation (for
            samples and documentation).
          </p></li><li class="listitem"><p>
            Age: Pre-Release, Current GA (default), or Other Releases.
          </p></li><li class="listitem"><p>
            Already Downloaded (the check box is deselected by default).
          </p></li><li class="listitem"><p>
            Architecture: Any (default), 32-bit, or 64-bit.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="MySQLInstallerConsole"></a>2.3.3.4 MySQLInstallerConsole Reference</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899659390976"></a><a class="indexterm" name="idm139899659389936"></a><a class="indexterm" name="idm139899659388864"></a><a class="indexterm" name="idm139899659387376"></a><p>
      <a class="link" href="installing.html#MySQLInstallerConsole" title="2.3.3.4 MySQLInstallerConsole Reference"><span class="command"><strong>MySQLInstallerConsole.exe</strong></span></a> provides command-line
      functionality that is similar to MySQL Installer. It is installed when MySQL Installer
      is initially executed and then available within the
      <code class="filename">MySQL Installer</code> directory. Typically, that is
      in <code class="filename">C:\Program Files (x86)\MySQL\MySQL
      Installer\</code>, and the console must be executed with
      administrative privileges.
    </p><p>
      To use, invoke the command prompt with administrative privileges
      by choosing <span class="guimenu">Start</span>,
      <span class="guimenu">Accessories</span>, then right-click on
      <span class="guimenu">Command Prompt</span> and choose <code class="literal">Run as
      administrator</code>. And from the command line, optionally
      change the directory to where
      <a class="link" href="installing.html#MySQLInstallerConsole" title="2.3.3.4 MySQLInstallerConsole Reference"><span class="command"><strong>MySQLInstallerConsole.exe</strong></span></a> is located:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>cd Program Files (x86)\MySQL\MySQL Installer for Windows</code></strong>
C:\Program Files (x86)\MySQL\MySQL Installer for Windows&gt; <strong class="userinput"><code>MySQLInstallerConsole.exe help</code></strong>
=================== Start Initialization ===================
MySQL Installer is running in Community mode

Attempting to update manifest.
Initializing product requirements
Loading product catalog
Checking for product catalog snippets
Checking for product packages in the bundle
Categorizing product catalog
Finding all installed packages.
Your product catalog was last updated at 11/1/2016 4:10:38 PM
=================== End Initialization ===================

The following commands are available:

Configure - Configures one or more of your installed programs.
Help      - Provides list of available commands.
Install   - Install and configure one or more available MySQL programs.
List      - Provides an interactive way to list all products available.
Modify    - Modifies the features of installed products.
Remove    - Removes one or more products from your system.
Status    - Shows the status of all installed products.
Update    - Update the current product catalog.
Upgrade   - Upgrades one or more of your installed programs.
</pre><p>
      <a class="link" href="installing.html#MySQLInstallerConsole" title="2.3.3.4 MySQLInstallerConsole Reference"><span class="command"><strong>MySQLInstallerConsole.exe</strong></span></a> supports the
      following commands:
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        Configuration block values that contain a colon (":") must be
        wrapped in double quotes. For example,
        installdir="C:\MySQL\MySQL Server 8.0".
</p>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="MySQLInstallerConsole-configure"></a>
          <a class="indexterm" name="idm139899659370752"></a>

          <a class="indexterm" name="idm139899659369264"></a>

          <code class="literal">configure <em class="replaceable"><code>[product1]:[setting]=[value];
          [product2]:[setting]=[value]; [...]</code></em></code>
        </p><p>
          Configure one or more MySQL products on your system. Multiple
          setting=value pairs can be configured for each product.
        </p><p>
          Switches include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">-showsettings</code> : Displays the available
              options for the selected product, by passing in the
              product name after <code class="literal">-showsettings</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">-silent</code> : Disable confirmation prompts.
</p></li></ul>
</div>
<pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole configure -showsettings server</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole configure server:port=3307</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-help"></a>
          <a class="indexterm" name="idm139899659357824"></a>

          <a class="indexterm" name="idm139899659356336"></a>

          <code class="literal">help <em class="replaceable"><code>[command]</code></em></code>
        </p><p>
          Displays a help message with usage examples, and then exits.
          Pass in an additional command to receive help specific to that
          command.
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole help</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole help install</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-install"></a>
          <a class="indexterm" name="idm139899659349680"></a>

          <a class="indexterm" name="idm139899659348192"></a>

          <code class="literal">install <em class="replaceable"><code>[product]:[features]:[config
          block]:[config block]:[config block];
          [...]</code></em></code>
        </p><p>
          Install one or more MySQL products on your system. If
          pre-release products are available, both GA and pre-release
          products are installed when the value of the
          <code class="literal">-type</code> switch is
          <code class="literal">Developer</code>, <code class="literal">Client</code>, or
          <code class="literal">Full</code>. Use the
          <code class="literal">-only_ga_products</code> switch to restrict the
          product set to GA products only when using these setup types.
        </p><p>
          Switches and syntax options include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">-only_ga_products</code> : Restricts the
              product set to include GA products only.
            </p></li><li class="listitem"><p>
              <code class="literal">-type=[SetupType]</code> : Installs a
              predefined set of software. The "SetupType" can be one of
              the following:
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                Non-custom setup types can only be chosen if no other
                MySQL products are installed.
</p>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; "><li class="listitem"><p>
                  <span class="bold"><strong>Developer</strong></span>: Installs a
                  complete development environment.
                </p></li><li class="listitem"><p>
                  <span class="bold"><strong>Server</strong></span>: Installs a
                  single MySQL server
                </p></li><li class="listitem"><p>
                  <span class="bold"><strong>Client</strong></span>: Installs
                  client programs and libraries
                </p></li><li class="listitem"><p>
                  <span class="bold"><strong>Full</strong></span>: Installs
                  everything
                </p></li><li class="listitem"><p>
                  <span class="bold"><strong>Custom</strong></span>: Installs user
                  selected products. This is the default option.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              <code class="literal">-showsettings</code> : Displays the available
              options for the selected product, by passing in the
              product name after <code class="literal">-showsettings</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">-silent</code> : Disable confirmation prompts.
            </p></li><li class="listitem"><p>
              <em class="replaceable"><code>[config block]</code></em>: One or more
              configuration blocks can be specified. Each configuration
              block is a semicolon separated list of key value pairs. A
              block can include either a "config" or "user" type key,
              where "config" is the default type if one is not defined.
            </p><p>
              Configuration block values that contain a colon character
              (<code class="literal">:</code>) must be wrapped in double quotes.
              For example, <code class="literal">installdir="C:\MySQL\MySQL Server
              8.0"</code>.
            </p><p>
              Only one "config" type block can be defined per product. A
              "user" block should be defined for each user that should
              be created during the product's installation.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                Adding users is not supported when a product is being
                reconfigured.
</p>
</div>
</li><li class="listitem"><p>
              <em class="replaceable"><code>[feature]</code></em>: The feature block is
              a semicolon separated list of features, or an asterisk
              character (<code class="literal">*</code>) to select all features.
</p></li></ul>
</div>
<pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole install server;5.6.25:*:port=3307;serverid=2:type=user;username=foo;password=bar;role=DBManager</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole install server;5.6.25;x64 -silent</code></strong>
</pre><p>
          An example that passes in additional configuration blocks,
          broken up by <code class="literal">^</code> to fit this screen:
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole install server;5.6.25;x64:*:type=config;openfirewall=true; ^
          generallog=true;binlog=true;serverid=3306;enable_tcpip=true;port=3306;rootpasswd=pass; ^
          installdir="C:\MySQL\MySQL Server 5.6":type=user;datadir="C:\MySQL\data";username=foo;password=bar;role=DBManager</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-list"></a>
          <a class="indexterm" name="idm139899659310608"></a>

          <a class="indexterm" name="idm139899659309120"></a>

          <code class="literal">list</code>
        </p><p>
          Lists an interactive console where all of the available MySQL
          products can be searched. Execute
          <code class="literal">MySQLInstallerConsole list</code> to launch the
          console, and enter in a substring to search.
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole list</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-modify"></a>
          <a class="indexterm" name="idm139899659302736"></a>

          <a class="indexterm" name="idm139899659301248"></a>

          <code class="literal">modify <em class="replaceable"><code>[product1:-removelist|+addlist]
          [product2:-removelist|+addlist] [...]</code></em></code>
        </p><p>
          Modifies or displays features of a previously installed MySQL
          product.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">-silent</code> : Disable confirmation prompts.
</p></li></ul>
</div>
<pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole modify server</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole modify server:+documentation</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole modify server:-debug</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-remove"></a>
          <a class="indexterm" name="idm139899659291872"></a>

          <a class="indexterm" name="idm139899659290384"></a>

          <code class="literal">remove <em class="replaceable"><code>[product1] [product2]
          [...]</code></em></code>
        </p><p>
          Removes one ore more products from your system.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">*</code> : Pass in <code class="literal">*</code> to
              remove all of the MySQL products.
            </p></li><li class="listitem"><p>
              <code class="literal">-continue</code> : Continue the operation even
              if an error occurs.
            </p></li><li class="listitem"><p>
              <code class="literal">-silent</code> : Disable confirmation prompts.
</p></li></ul>
</div>
<pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole remove *</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole remove server</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-status"></a>
          <a class="indexterm" name="idm139899659278176"></a>

          <a class="indexterm" name="idm139899659276688"></a>

          <code class="literal">status</code>
        </p><p>
          Provides a quick overview of the MySQL products that are
          installed on the system. Information includes product name and
          version, architecture, date installed, and install location.
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole status</code></strong>
</pre></li><li class="listitem"><p><a name="MySQLInstallerConsole-update"></a>
          <a class="indexterm" name="idm139899659271008"></a>

          <a class="indexterm" name="idm139899659269520"></a>

          <code class="literal">update</code>
        </p><p>
          Downloads the latest MySQL product catalog to your system. On
          success, the download catalog will be applied the next time
          either MySQLInstaller or MySQLInstallerConsole is executed.
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole <em class="replaceable"><code>update</code></em></code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            The <span class="guilabel">Automatic Catalog Update</span> GUI option
            executes this command from the Windows Task Scheduler.
</p>
</div>
</li><li class="listitem"><p><a name="MySQLInstallerConsole-upgrade"></a>
          <a class="indexterm" name="idm139899659261888"></a>

          <a class="indexterm" name="idm139899659260400"></a>

          <code class="literal">upgrade <em class="replaceable"><code>[product1:version]
          [product2:version] [...]</code></em></code>
        </p><p>
          Upgrades one or more products on your system. Syntax options
          include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">*</code> : Pass in <code class="literal">*</code> to
              upgrade all products to the latest version, or pass in
              specific products.
            </p></li><li class="listitem"><p>
              <code class="literal">!</code> : Pass in <code class="literal">!</code> as a
              version number to upgrade the MySQL product to its latest
              version.
            </p></li><li class="listitem"><p>
              <code class="literal">-silent</code> : Disable confirmation prompts.
</p></li></ul>
</div>
<pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole upgrade *</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole upgrade workbench:6.3.5</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole upgrade workbench:!</code></strong>
C:\&gt; <strong class="userinput"><code>MySQLInstallerConsole upgrade workbench:6.3.5 excel:1.3.2</code></strong>
</pre></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-notifier"></a>2.3.4 MySQL Notifier</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#windows-notifier-usage">2.3.4.1 MySQL Notifier Usage</a></span></dt><dt><span class="section"><a href="installing.html#windows-notifier-installation">2.3.4.2 Setting Up Remote Monitoring in MySQL Notifier</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899659245072"></a><a class="indexterm" name="idm139899659244032"></a><p>
    MySQL Notifier is a tool that enables you to monitor and adjust the
    status of your local and remote MySQL server instances through an
    indicator that resides in the Microsoft Windows taskbar. MySQL Notifier
    also gives quick access to MySQL Workbench through its context menu.
  </p><p>
    MySQL Notifier is installed by using MySQL Installer. It can be loaded
    automatically when Microsoft Windows is started.
  </p><p>
    To install, download and execute the
    <a class="ulink" href="http://dev.mysql.com/downloads/installer/" target="_top">MySQL Installer</a>.
    With MySQL Notifier selected from Applications, proceed with the
    installation. See the <a class="link" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">MySQL Installer
    manual</a> for additional details.
  </p><p>
    For notes detailing the changes in each release of MySQL Notifier, see
    the <a class="ulink" href="http://dev.mysql.com/doc/relnotes/mysql-notifier/en/" target="_top">MySQL
    Notifier Release Notes</a>.
  </p><p>
    Visit the <a class="ulink" href="http://forums.mysql.com/list.php?173" target="_top">MySQL
    Notifier forum</a> for additional MySQL Notifier help and support.
</p>
<h4><a name="idm139899659237152"></a>Features include:</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        Start, stop, and restart instances of the MySQL server.
      </p></li><li class="listitem"><p>
        Automatically detects (and adds) new MySQL server services.
        These are listed under <span class="guimenu">Manage Monitored
        Items</span>, and may also be configured.
      </p></li><li class="listitem"><p>
        The Tray icon changes, depending on the status. It is a
        ﻿right-pointing green triangle if all monitored MySQL server
        instances are running or a red square if at least one service is
        stopped. The <span class="guilabel">Update MySQL Notifier tray icon based on
        service status</span> option, which dictates this behavior,
        is enabled by default for each service.
      </p></li><li class="listitem"><p>
        Links to other applications like MySQL Workbench, MySQL Installer, and the
        MySQL Utilities. For example, choosing <span class="guimenu">Manage
        Instance</span> will load the MySQL Workbench Server
        Administration window for that particular instance.
      </p></li><li class="listitem"><p>
        If MySQL Workbench is also installed, then the <span class="guimenu">Manage
        Instance</span> and <span class="guimenu">SQL Editor</span> options are
        available for local (but not remote) MySQL instances.
      </p></li><li class="listitem"><p>
        Monitors both local and remote MySQL instances.
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-notifier-usage"></a>2.3.4.1 MySQL Notifier Usage</h4>

</div>

</div>

</div>
<p>
      MySQL Notifier provides visual status information for the MySQL
      servers that are monitored on both local or remote computers. The
      MySQL Notifier icon in the taskbar changes color to indicate the
      current status: Running or Stopped.
    </p><p>
      MySQL Notifier automatically adds discovered MySQL services on the
      local computer. By default, the <span class="guilabel">Automatically add new
      services whose name contains</span> option is enabled and set
      to <code class="literal">mysql</code>. Related notification options include
      being notified when new services are either discovered or
      experience status changes, and are also enabled by default.
      Uninstalling a service removes the service from MySQL Notifier.
    </p><p>
      Clicking the MySQL Notifier icon from the Windows taskbar reveals the
      MySQL Notifier main menu, which lists each MySQL server separately
      and displays its current status. You can start, stop, or restart
      each MySQL server from the menu as the following figure shows.
      When MySQL Workbench is installed locally, the <span class="guimenuitem">Manage
      Instance</span> and <span class="guimenuitem">SQL Editor</span>
      menu items start the application.
</p>
<div class="figure">
<a name="windows-notifier-server-instance"></a><p class="title"><b>Figure 2.14 MySQL Notifier Service Instance Menu</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/windows-notifier-server-instance.png" width="341" height="213" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><p>
      The <span class="guimenu">Actions</span> menu includes the following items:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <span class="guilabel">Manage Monitored Items</span>
        </p></li><li class="listitem"><p>
          <span class="guilabel">Launch MySQL Installer</span> (Only when the product is
          installed.)
        </p></li><li class="listitem"><p>
          <span class="guilabel">Check for Updates</span> (Only when MySQL Installer is
          installed.)
        </p></li><li class="listitem"><p>
          <span class="guilabel">MySQL Utilities Shell</span> (Only when the
          product is installed.)
        </p></li><li class="listitem"><p>
          <span class="guilabel">Refresh Status</span>
        </p></li><li class="listitem"><p>
          <span class="guilabel">Options</span>
        </p></li><li class="listitem"><p>
          <span class="guilabel">About</span>
        </p></li><li class="listitem"><p>
          <span class="guilabel">Close MySQL Notifier</span>
</p></li></ul>
</div>
<p>
      The main menu does not show the <span class="guimenu">Actions</span> menu
      when there are no services being monitored by MySQL Notifier.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="windows-notifier-options"></a>MySQL Notifier Options</h5>
</div>
</div>
</div>
<p>
        The <span class="guimenu">Actions</span>, <span class="guimenu">Options</span> menu
        provides a set of options that configure MySQL Notifier operations.
        Options are grouped into the following categories:
        <span class="guilabel">General Options</span>, <span class="guilabel">Notification
        Options</span>, and <span class="guilabel">MySQL Server Connections
        Options</span>.
      </p><p>
        Click <span class="guibutton">Accept</span> to enable the selected
        options or <span class="guibutton">Cancel</span> to ignore all changes.
        Click <span class="guibutton">Reset to Defaults</span> and then
        <span class="guibutton">Accept</span> to apply default option values.
      </p><p><b>General Options. </b>
          This group includes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="guilabel">Use colorful status icons</span>: Enables a
            colorful style of icons for the tray of MySQL Notifier.
            Selected by default.
          </p></li><li class="listitem"><p>
            <span class="guilabel">Run at Windows Startup</span>: Allows the
            application to be loaded when Microsoft Windows starts.
            Deselected by default.
          </p></li><li class="listitem"><p>
            <span class="guilabel">Automatically Check For Updates Every</span> #
            <span class="guilabel">Weeks</span>: Checks for a new version of
            MySQL Notifier, and runs this check every # weeks. Selected by
            default with the updates every four weeks.
          </p></li><li class="listitem"><p>
            <span class="guilabel">Automatically add new services whose name
            contains:</span> The text used to filter services and
            add them automatically to the monitored list of the local
            computer running MySQL Notifier and on remote computers already
            monitoring Windows services. Selected by default for names
            containing <code class="literal">mysql</code>.
          </p></li><li class="listitem"><p>
            <span class="guilabel">Ping monitored MySQL Server instances
            every</span> # <span class="guilabel">seconds</span>: The
            interval (in seconds) to ping monitored MySQL Server
            instances for status changes. Longer intervals might be
            necessary if the list of monitored remote instances is
            large. 30 seconds by default.
</p></li></ul>
</div>
<p><b>Notification Options. </b>
          This group includes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="guilabel">Notify me when a service is automatically
            added</span>: Display a balloon notification from the
            taskbar when a newly discovered service is added to the
            monitored services list. Selected by default.
          </p></li><li class="listitem"><p>
            <span class="guilabel">Notify me when a service changes
            status</span>: Displays a balloon notification from the
            taskbar when a monitored service changes its status.
            Selected by default.
</p></li></ul>
</div>
<p><b>MySQL Server Connections Options. </b>
          This group includes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="guilabel">Automatic connections migration delayed
            until:</span> When there are connections to migrate to
            MySQL Workbench (if installed), this option postpones the
            migration by one hour, one day, one week, one month, or
            indefinitely.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="windows-notifier-monitor-items"></a>Managing Monitored Items</h5>

</div>

</div>

</div>
<p>
        The <span class="guimenu">Actions</span>, <span class="guimenu">Manage Monitored
        Items</span> menu enables you to add, configure, and delete
        the services and MySQL instances you intend to monitor. The
        <span class="guilabel">Manage Items</span> window has two tabs:
        <span class="guilabel">Services</span> and
        <span class="guilabel">Instances</span>.
      </p><p><b>Services Tab. </b>
          When MySQL is configured as a local service, MySQL Notifier adds
          the service to the <span class="guilabel">Services</span> tab
          automatically. With the <span class="guilabel">Services</span> tab
          open, you can select the following options that apply to all
          services being monitored:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="guilabel">Notify me when status changes</span>
          </p></li><li class="listitem"><p>
            <span class="guilabel">Update MySQL Notifier tray icon based on service
            status</span>
</p></li></ul>
</div>
<p>
        The next figure shows the <span class="guilabel">Services</span> tab open
        and both options selected. This tab shows the service name, the
        computer where the service is hosted, and the current status of
        the service.
</p>
<div class="figure">
<a name="windows-notifier-manage-services"></a><p class="title"><b>Figure 2.15 MySQL Notifier: Manage Services</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/windows-notifier-manage-services.png" width="602" height="529" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><p>
        To stop monitoring a service, select it from the list of
        monitored services and click <span class="guibutton">Delete</span>.
      </p><p>
        Click <span class="guibutton">Add</span> and then <span class="guimenuitem">Windows
        Service</span> to open the <span class="guilabel">Add
        Service</span> window. To add a new service, select a
        computer from the drop-down list, choose a service from the
        list, and then click <span class="guibutton">OK</span> to accept. Use
        the <span class="guilabel">Filter</span> field to reduce the set of
        services in the list or select <span class="guilabel">Only show services that
        match auto-add filter?</span> to reuse the general-options
        filter from the <span class="guimenuitem">Options</span> menu.
      </p><p>
        A variety of Windows services (including MySQL) may be selected
        as the following figure shows. In addition to the service name,
        the list shows the current status of each Windows services for
        the selected computer.
</p>
<div class="figure">
<a name="windows-notifier-add-services"></a><p class="title"><b>Figure 2.16 MySQL Notifier: Adding New Services</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/windows-notifier-manage-services-add.png" width="504" height="578" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><p><b>Instances Tab. </b>
          When MySQL is configured as a MySQL instance, MySQL Notifier adds
          the instance to the <span class="guilabel">Instances</span> tab
          automatically. With the <span class="guilabel">Instances</span> tab
          open, you can select the following options that apply to each
          instance being monitored:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="guilabel">Notify me when status changes</span>
          </p></li><li class="listitem"><p>
            <span class="guilabel">Update MySQL Notifier tray icon based on service
            status</span>
          </p></li><li class="listitem"><p>
            <span class="guilabel">Monitor MySQL Instance status every</span> [ #
            ] [ seconds | minutes | hours | days ]
</p></li></ul>
</div>
<p>
        The next figure shows the <span class="guilabel">Instances</span> tab
        open and both options selected. Monitoring the instance status
        is set to every two minutes in this example. This tab shows the
        instance name, the database driver, and the current status of
        the instance.
</p>
<div class="figure">
<a name="windows-notifier-manage-instances"></a><p class="title"><b>Figure 2.17 MySQL Notifier: Manage MySQL Instances</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/windows-notifier-manage-instances.png" width="602" height="529" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><p>
        To stop monitoring an instance, select it from the list of
        monitored MySQL instances and click
        <span class="guibutton">Delete</span>.
      </p><p>
        Click <span class="guibutton">Add</span> and then <span class="guimenuitem">MySQL
        Instances</span> to open the <span class="guilabel">Monitor MySQL
        Server Instance</span> window. Use the
        <span class="guilabel">Filter</span> field to reduce the set of instances
        in the list or select <span class="guilabel">Show MySQL instances already
        being monitored?</span> to show monitored items only.
      </p><p>
        Optionally, you can select a connection from MySQL Workbench to
        monitor. Click <span class="guibutton">Add New Connection</span>, shown
        in the next figure, to create a new connection.
</p>
<div class="figure">
<a name="windows-notifier-add-instances"></a><p class="title"><b>Figure 2.18 MySQL Notifier: Adding New Instances</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/windows-notifier-manage-instances-add.png" width="610" height="600" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break">
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="windows-notifier-troubleshooting"></a>Troubleshooting</h5>

</div>

</div>

</div>
<p>
        For issues that are not documented here, visit the
        <a class="ulink" href="http://forums.mysql.com/list.php?173" target="_top">MySQL Notifier
        Support Forum</a> for MySQL Notifier help and support.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="emphasis"><em>Problem</em></span>: attempting to
            start/stop/restart a MySQL service might generate an error
            similar to "The Service
            <span class="bold"><strong>MySQL<em class="replaceable"><code>VERSION</code></em></strong></span>
            failed the most recent status change request with the
            message "The service
            <span class="bold"><strong>mysql<em class="replaceable"><code>VERSION</code></em></strong></span>
            was not found in the Windows Services".
          </p><p>
            <span class="emphasis"><em>Explanation</em></span>: this is a case-sensitivity
            issue, in that the service name is
            <span class="bold"><strong>MySQL<em class="replaceable"><code>VERSION</code></em></strong></span>
            compared to having
            <span class="bold"><strong>mysql<em class="replaceable"><code>VERSION</code></em></strong></span>
            in the configuration file.
          </p><p>
            <span class="emphasis"><em>Solution</em></span>: either update your
            MySQL Notifier configuration file with the correct information,
            or stop MySQL Notifier and delete this configuration file. The
            MySQL Notifier configuration file is located at
            <code class="filename">%APPDATA%\Oracle\MySQL
            Notifier\settings.config</code> where
            <code class="literal">%APPDATA%</code> is a variable and depends on
            your system. A typical location is
            "C:\Users\<em class="replaceable"><code>YourUsername</code></em>\AppData\Running\Oracle\MySQL
            Notifier\settings.config" where
            <em class="replaceable"><code>YourUsername</code></em> is your system's
            user name. In this file, and within the ServerList section,
            change the ServerName values from lowercase to the actual
            service names. For example, change
            <span class="bold"><strong>mysql<em class="replaceable"><code>VERSION</code></em></strong></span>
            to
            <span class="bold"><strong>MySQL<em class="replaceable"><code>VERSION</code></em></strong></span>,
            save, and then restart MySQL Notifier. Alternatively, stop
            MySQL Notifier, delete this file, then restart MySQL Notifier.
          </p></li><li class="listitem"><p>
            <span class="emphasis"><em>Problem</em></span>: when connecting to a remote
            computer for the purpose of monitoring a remote Windows
            service, the <span class="guilabel">Add Service</span> dialog does
            not always show all the services shown in the Windows
            Services console.
          </p><p>
            <span class="emphasis"><em>Explanation</em></span>: this behavior is governed
            by the operating system and the outcome is expected when
            working with nondomain user accounts. For a complete
            description of the behavior, see the
            <a class="ulink" href="https://msdn.microsoft.com/en-us/library/aa826699(VS.85).aspx" target="_top">User
            Account Control and WMI</a> article from Microsoft.
          </p><p>
            <span class="emphasis"><em>Solution</em></span>: when the remote computer is
            in a compatible domain, it is recommended that domain user
            accounts are used to connect through WMI to a remote
            computer. For detailed setup instructions using WMI, see
            <a class="xref" href="installing.html#windows-notifier-installation" title="2.3.4.2 Setting Up Remote Monitoring in MySQL Notifier">Section 2.3.4.2, “Setting Up Remote Monitoring in MySQL Notifier”</a>.
          </p><p>
            Alternatively, when domain user accounts are not available,
            Microsoft provides a less secure workaround that should only
            be implemented with caution. For more information, see the
            <a class="ulink" href="https://support.microsoft.com/en-us/kb/951016" target="_top">Description
            of User Account Control and remote restrictions in Windows
            Vista</a> KB article from Microsoft.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-notifier-installation"></a>2.3.4.2 Setting Up Remote Monitoring in MySQL Notifier</h4>

</div>

</div>

</div>
<p>
      MySQL Notifier uses Windows Management Instrumentation (WMI) to
      manage and monitor services on remote computers. This section
      explains how it works and how to set up your system to monitor
      remote MySQL instances.
    </p><p>
      In order to configure WMI, it is important to understand that the
      underlying Distributed Component Object Model (DCOM) architecture
      is doing the WMI work. Specifically, MySQL Notifier is using
      asynchronous notification queries on remote Microsoft Windows
      hosts as .NET events. These events send an asynchronous callback
      to the computer running MySQL Notifier so it knows when a service
      status has changed on the remote computer. Asynchronous
      notifications offer the best performance compared to
      semisynchronous notifications or synchronous notifications that
      use timers.
    </p><p>
      As the following figure shows, asynchronous notification requires
      the remote computer to send a callback to the client computer
      (thus opening a reverse connection), so the Windows Firewall and
      DCOM settings must be properly configured for the communication to
      function properly. The client (Computer A), which includes an
      unsecured application (<code class="filename">unsecapp.exe</code> in this
      example), makes an asynchronous call to a remote computer
      (Computer B) and receives a call back with data.
</p>
<div class="figure">
<a name="windows-notifier-installation-wmi"></a><p class="title"><b>Figure 2.19 MySQL Notifier Distributed Component Object Model (DCOM)</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/windows-notifier-wmi-diagram.png" width="661" height="194" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><p>
      Most of the common errors thrown by asynchronous WMI notifications
      are related to Windows Firewall blocking the communication, or to
      DCOM / WMI settings not being set up properly. For a list of
      common errors with solutions, see
      <a class="xref" href="installing.html#windows-notifier-installation-errors" title="Common Errors">Common Errors</a>.
    </p><p>
      The following steps are required to make WMI function. These steps
      are divided between two machines. A single host computer that runs
      MySQL Notifier (Computer A), and multiple remote machines that are
      being monitored (Computer B).
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="windows-notifier-remote-computer-a"></a>Computer running MySQL Notifier (Computer A)</h5>
</div>
</div>
</div>

<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Enable remote administration by either editing the
            <span class="guilabel">Group Policy Editor</span>, or using
            <code class="literal">NETSH</code>:
          </p><p>
            Using the <span class="guilabel">Group Policy Editor</span>:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Click <span class="guibutton">Start</span>, click
                <span class="guibutton">Run</span>, type
                <code class="filename">GPEDIT.MSC</code>, and then click
                <span class="guibutton">OK</span>.
              </p></li><li class="listitem"><p>
                Under the <span class="guilabel">Local Computer Policy</span>
                heading, expand <span class="guilabel">Computer
                Configuration</span>.
              </p></li><li class="listitem"><p>
                Expand <span class="guilabel">Administrative Templates</span>,
                then <span class="guilabel">Network</span>, <span class="guilabel">Network
                Connections</span>, and then <span class="guilabel">Windows
                Firewall</span>.
              </p></li><li class="listitem"><p>
                If the computer is in the domain, then double-click
                <span class="guilabel">Domain Profile</span>; otherwise,
                double-click <span class="guilabel">Standard Profile</span>.
              </p></li><li class="listitem"><p>
                Double-click <span class="guilabel">Windows Firewall: Allow inbound
                remote administration exception</span> to open a
                configuration window.
              </p></li><li class="listitem"><p>
                Check the <span class="guibutton">Enabled</span> option button
                and then click <span class="guibutton">OK</span>.
</p></li></ol>
</div>
<p>
            Using the <code class="literal">NETSH</code> command:
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              The "netsh firewall" command is deprecated as of Microsoft
              Server 2008 and Vista, and replaced with "netsh
              advfirewall firewall".
</p>
</div>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Open a command prompt window with Administrative rights
                (you can right-click the Command Prompt icon and select
                <span class="guilabel">Run as Administrator</span>).
              </p></li><li class="listitem"><p>
                Execute the following command:
              </p><pre class="programlisting">
NETSH advfirewall firewall set service RemoteAdmin enable
</pre></li></ol>
</div>
</li><li class="listitem"><p>
            Open the DCOM port TCP 135:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Open a command prompt window with Administrative rights
                (you can right-click the Command Prompt icon and select
                <span class="guilabel">Run as Administrator</span>).
              </p></li><li class="listitem"><p>
                Execute the following command:
              </p><pre class="programlisting">
NETSH advfirewall firewall add rule name=DCOM_TCP135 protocol=TCP localport=135 dir=in action=allow
</pre></li></ol>
</div>
</li><li class="listitem"><p>
            Add the client application that contains the sink for the
            callback (<code class="filename">MySqlNotifier.exe</code>) to the
            Windows Firewall Exceptions List (use either the Windows
            Firewall configuration or <code class="literal">NETSH</code>):
          </p><p>
            Using the Windows Firewall configuration:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                In the Control Panel, double-click <span class="guilabel">Windows
                Firewall</span>.
              </p></li><li class="listitem"><p>
                In the Windows Firewall window, click <span class="guilabel">Allow a
                program or feature through Windows Firewall</span>.
              </p></li><li class="listitem"><p>
                In the Allowed Programs window, click <span class="guibutton">Change
                Settings</span> and do one of the following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                    If <code class="filename">MySqlNotifier.exe</code> is in the
                    Allowed programs and features list, make sure it is
                    checked for the type of networks the computer
                    connects to (Private, Public or both).
                  </p></li><li class="listitem"><p>
                    If <code class="filename">MySqlNotifier.exe</code> is not in
                    the list, click <span class="guibutton">Allow another
                    program</span>.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="i"><li class="listitem"><p>
                        In the <span class="guilabel">Add a Program</span>
                        window, select the
                        <code class="filename">MySqlNotifier.exe</code> if it
                        exists in the Programs list, otherwise click
                        <span class="guibutton">Browse</span> and go to the
                        directory where
                        <code class="filename">MySqlNotifier.exe</code> was
                        installed to select it, then click
                        <span class="guibutton">Add</span>.
                      </p></li><li class="listitem"><p>
                        Make sure <code class="filename">MySqlNotifier.exe</code>
                        is checked for the type of networks the computer
                        connects to (Private, Public or both).
</p></li></ol>
</div>
</li></ul>
</div>
</li></ol>
</div>
<p>
            Using the <code class="literal">NETSH</code> command:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Open a command prompt window with Administrative rights
                (you can right-click the Command Prompt icon and click
                <span class="guibutton">Run as Administrator</span>).
              </p></li><li class="listitem"><p>
                Execute the following command, where you change
                "<em class="replaceable"><code>[YOUR_INSTALL_DIRECTORY]</code></em>":
              </p><pre class="programlisting">
NETSH advfirewall firewall add rule name=MySqlNotifier program=[YOUR_INSTALL_DIRECTORY]\MySqlNotifier.exe action=allow dir=in
</pre></li></ol>
</div>
</li><li class="listitem"><p>
            If Computer B is either a member of
            <code class="literal">WORKGROUP</code> or is in a different domain
            that is untrusted by Computer A, then the callback
            connection (Connection 2) is created as an Anonymous
            connection. To grant Anonymous connections DCOM Remote
            Access permissions:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Click <span class="guibutton">Start</span>, click
                <span class="guibutton">Run</span>, type
                <code class="literal">DCOMCNFG</code>, and then click
                <span class="guibutton">OK</span>.
              </p></li><li class="listitem"><p>
                In the Component Services dialog box, expand Component
                Services, expand Computers, and then right-click
                <span class="guilabel">My Computer</span> and click
                <span class="guibutton">Properties</span>.
              </p></li><li class="listitem"><p>
                In the My Computer Properties dialog box, click the
                <span class="guilabel">COM Security</span> tab.
              </p></li><li class="listitem"><p>
                Under Access Permissions, click <span class="guibutton">Edit
                Limits</span>.
              </p></li><li class="listitem"><p>
                In the Access Permission dialog box, select
                <span class="guilabel">ANONYMOUS LOGON name</span> in the Group
                or user names box. In the Allow column under Permissions
                for User, select <span class="guilabel">Remote Access</span>, and
                then click <span class="guibutton">OK</span>.
</p></li></ol>
</div>
</li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="windows-notifier-remote-computer-b"></a>Monitored Remote Computer (Computer B)</h5>

</div>

</div>

</div>
<p>
        If the user account that is logged on to the computer running
        the MySQL Notifier (Computer A) is a local administrator on the
        remote computer (Computer B), such that the same account is an
        administrator on Computer B, you can skip to the "Allow for
        remote administration" step.
      </p><p>
        Setting DCOM security to allow a non-administrator user to
        access a computer remotely:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Grant "DCOM remote launch" and activation permissions for a
            user or group:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Click <span class="guibutton">Start</span>, click
                <span class="guibutton">Run</span>, type
                <code class="literal">DCOMCNFG</code>, and then click
                <span class="guibutton">OK</span>.
              </p></li><li class="listitem"><p>
                In the Component Services dialog box, expand Component
                Services, expand Computers, and then right-click
                <span class="guilabel">My Computer</span> and click
                <span class="guibutton">Properties</span>.
              </p></li><li class="listitem"><p>
                In the My Computer Properties dialog box, click the
                <span class="guilabel">COM Security</span> tab.
              </p></li><li class="listitem"><p>
                Under Launch and Activation Permission, click
                <span class="guibutton">Edit Limits</span>.
              </p></li><li class="listitem"><p>
                In the <span class="guilabel">Launch and Activation
                Permission</span> dialog box, follow these steps if
                your name or your group does not appear in the Groups or
                user names list:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="i"><li class="listitem"><p>
                    In the <span class="guilabel">Launch and Activation
                    Permission</span> dialog box, click
                    <span class="guibutton">Add</span>.
                  </p></li><li class="listitem"><p>
                    In the Select Users or Groups dialog box, add your
                    name and the group in the <span class="guilabel">Enter the object
                    names to select</span> box, and then click
                    <span class="guibutton">OK</span>.
</p></li></ol>
</div>
</li><li class="listitem"><p>
                In the <span class="guilabel">Launch and Activation
                Permission</span> dialog box, select your user and
                group in the Group or user names box. In the Allow
                column under Permissions for User, select
                <span class="guilabel">Remote Launch</span>, select
                <span class="guilabel">Remote Activation</span>, and then click
                <span class="guibutton">OK</span>.
</p></li></ol>
</div>
<p>
            Grant DCOM remote access permissions:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Click <span class="guibutton">Start</span>, click
                <span class="guibutton">Run</span>, type
                <code class="literal">DCOMCNFG</code>, and then click
                <span class="guibutton">OK</span>.
              </p></li><li class="listitem"><p>
                In the Component Services dialog box, expand Component
                Services, expand Computers, and then right-click
                <span class="guilabel">My Computer</span> and click
                <span class="guibutton">Properties</span>.
              </p></li><li class="listitem"><p>
                In the My Computer Properties dialog box, click the
                <span class="guilabel">COM Security</span> tab.
              </p></li><li class="listitem"><p>
                Under Access Permissions, click <span class="guibutton">Edit
                Limits</span>.
              </p></li><li class="listitem"><p>
                In the Access Permission dialog box, select
                <span class="guilabel">ANONYMOUS LOGON name</span> in the Group
                or user names box. In the Allow column under Permissions
                for User, select <span class="guilabel">Remote Access</span>, and
                then click <span class="guibutton">OK</span>.
</p></li></ol>
</div>
</li><li class="listitem"><p>
            Allowing non-administrator users access to a specific WMI
            namespace:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                In the Control Panel, double-click
                <span class="guilabel">Administrative Tools</span>.
              </p></li><li class="listitem"><p>
                In the Administrative Tools window, double-click
                <span class="guilabel">Computer Management</span>.
              </p></li><li class="listitem"><p>
                In the Computer Management window, expand the
                <span class="guilabel">Services and Applications</span> tree.
              </p></li><li class="listitem"><p>
                Right-click the WMI Control icon and select
                <span class="guilabel">Properties</span>.
              </p></li><li class="listitem"><p>
                In the WMI Control Properties window, click the
                <span class="guilabel">Security</span> tab.
              </p></li><li class="listitem"><p>
                In the Security tab, select the namespace and click
                <span class="guibutton">Security</span>. Root/CIMV2 is a
                commonly used namespace.
              </p></li><li class="listitem"><p>
                Locate the appropriate account and check
                <span class="guilabel">Remote Enable</span> in the Permissions
                list.
</p></li></ol>
</div>
</li><li class="listitem"><p>
            Allow for remote administration by either editing the
            <span class="guilabel">Group Policy Editor</span> or using
            <code class="literal">NETSH</code>:
          </p><p>
            Using the <span class="guilabel">Group Policy Editor</span>:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Click <span class="guibutton">Start</span>, click
                <span class="guibutton">Run</span>, type
                <code class="filename">GPEDIT.MSC</code>, and then click
                <span class="guibutton">OK</span>.
              </p></li><li class="listitem"><p>
                Under the Local Computer Policy heading, double-click
                <span class="guilabel">Computer Configuration</span>.
              </p></li><li class="listitem"><p>
                Double-click <span class="guilabel">Administrative
                Templates</span>, then <span class="guilabel">Network</span>,
                <span class="guilabel">Network Connections</span>, and then
                <span class="guilabel">Windows Firewall</span>.
              </p></li><li class="listitem"><p>
                If the computer is in the domain, then double-click
                <span class="guilabel">Domain Profile</span>; otherwise,
                double-click <span class="guilabel">Standard Profile</span>.
              </p></li><li class="listitem"><p>
                Click <span class="guilabel">Windows Firewall: Allow inbound remote
                administration exception</span>.
              </p></li><li class="listitem"><p>
                On the Action menu either select
                <span class="guibutton">Edit</span>, or double-click the
                selection from the previous step.
              </p></li><li class="listitem"><p>
                Check the <span class="guibutton">Enabled</span> radio button,
                and then click <span class="guibutton">OK</span>.
</p></li></ol>
</div>
<p>
            Using the <code class="literal">NETSH</code> command:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Open a command prompt window with Administrative rights
                (you can right-click the Command Prompt icon and click
                <span class="guimenuitem">Run as Administrator</span>).
              </p></li><li class="listitem"><p>
                Execute the following command:
              </p><pre class="programlisting">
NETSH advfirewall firewall set service RemoteAdmin enable
</pre></li></ol>
</div>
</li><li class="listitem"><p>
            Confirm that the user account you are logging in with uses
            the <code class="literal">Name</code> value and not the <code class="literal">Full
            Name</code> value:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                In the <span class="guilabel">Control Panel</span>, double-click
                <span class="guilabel">Administrative Tools</span>.
              </p></li><li class="listitem"><p>
                In the <span class="guilabel">Administrative Tools</span> window,
                double-click <span class="guilabel">Computer Management</span>.
              </p></li><li class="listitem"><p>
                In the <span class="guilabel">Computer Management</span> window,
                expand the <span class="guilabel">System Tools</span> then
                <span class="guilabel">Local Users and Groups</span>.
              </p></li><li class="listitem"><p>
                Click the <span class="guilabel">Users</span> node, and on the
                right side panel locate your user and make sure it uses
                the <span class="guilabel">Name</span> value to connect, and not
                the <span class="guilabel">Full Name</span> value.
</p></li></ol>
</div>
</li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="windows-notifier-installation-errors"></a>Common Errors</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">0x80070005</code>
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                DCOM Security was not configured properly (see Computer
                B, the <code class="literal">Setting DCOM security...</code>
                step).
              </p></li><li class="listitem"><p>
                The remote computer (Computer B) is a member of
                WORKGROUP or is in a domain that is untrusted by the
                client computer (Computer A) (see Computer A, the
                <code class="literal">Grant Anonymous connections DCOM Remote Access
                permissions</code> step).
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">0x8007000E</code>
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                The remote computer (Computer B) is a member of
                WORKGROUP or is in a domain that is untrusted by the
                client computer (Computer A) (see Computer A, the
                <code class="literal">Grant Anonymous connections DCOM Remote Access
                permissions</code> step).
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">0x80041003</code>
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                Access to the remote WMI namespace was not configured
                properly (see Computer B, the <code class="literal">Allowing
                non-administrator users access to a specific WMI
                namespace</code> step).
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">0x800706BA</code>
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                The DCOM port is not open on the client computers
                (Computer A) firewall. See the <code class="literal">Open the DCOM
                port TCP 135</code> step for Computer A.
              </p></li><li class="listitem"><p>
                The remote computer (Computer B) is inaccessible because
                its network location is set to Public. Make sure you can
                access it through the Windows Explorer.
</p></li></ul>
</div>
</li></ul>
</div>

</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-install-archive"></a>2.3.5 Installing MySQL on Microsoft Windows Using a
<code class="literal">noinstall</code> ZIP Archive</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#windows-extract-archive">2.3.5.1 Extracting the Install Archive</a></span></dt><dt><span class="section"><a href="installing.html#windows-create-option-file">2.3.5.2 Creating an Option File</a></span></dt><dt><span class="section"><a href="installing.html#windows-select-server">2.3.5.3 Selecting a MySQL Server Type</a></span></dt><dt><span class="section"><a href="installing.html#windows-initialize-data-directory">2.3.5.4 Initializing the Data Directory</a></span></dt><dt><span class="section"><a href="installing.html#windows-server-first-start">2.3.5.5 Starting the Server for the First Time</a></span></dt><dt><span class="section"><a href="installing.html#windows-start-command-line">2.3.5.6 Starting MySQL from the Windows Command Line</a></span></dt><dt><span class="section"><a href="installing.html#mysql-installation-windows-path">2.3.5.7 Customizing the PATH for MySQL Tools</a></span></dt><dt><span class="section"><a href="installing.html#windows-start-service">2.3.5.8 Starting MySQL as a Windows Service</a></span></dt><dt><span class="section"><a href="installing.html#windows-testing">2.3.5.9 Testing The MySQL Installation</a></span></dt></dl>
</div>
<p>
      Users who are installing from the <code class="literal">noinstall</code>
      package can use the instructions in this section to manually
      install MySQL. The process for installing MySQL from a ZIP Archive
      package is as follows:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Extract the main archive to the desired install directory
        </p><p>
          <span class="emphasis"><em>Optional</em></span>: also extract the debug-test
          archive if you plan to execute the MySQL benchmark and test
          suite
        </p></li><li class="listitem"><p>
          Create an option file
        </p></li><li class="listitem"><p>
          Choose a MySQL server type
        </p></li><li class="listitem"><p>
          Initialize MySQL
        </p></li><li class="listitem"><p>
          Start the MySQL server
        </p></li><li class="listitem"><p>
          Secure the default user accounts
</p></li></ol>
</div>
<p>
      This process is described in the sections that follow.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-extract-archive"></a>2.3.5.1 Extracting the Install Archive</h4>
</div>
</div>
</div>
<p>
        To install MySQL manually, do the following:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            If you are upgrading from a previous version please refer to
            <a class="xref" href="installing.html#windows-upgrading" title="2.3.8 Upgrading MySQL on Windows">Section 2.3.8, “Upgrading MySQL on Windows”</a>, before beginning the
            upgrade process.
          </p></li><li class="listitem"><p>
            Make sure that you are logged in as a user with
            administrator privileges.
          </p></li><li class="listitem"><p>
            Choose an installation location. Traditionally, the MySQL
            server is installed in <code class="filename">C:\mysql</code>. If you
            do not install MySQL at <code class="filename">C:\mysql</code>, you
            must specify the path to the install directory during
            startup or in an option file. See
            <a class="xref" href="installing.html#windows-create-option-file" title="2.3.5.2 Creating an Option File">Section 2.3.5.2, “Creating an Option File”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              The MySQL Installer installs MySQL under <code class="filename">C:\Program
              Files\MySQL</code>.
</p>
</div>
</li><li class="listitem"><p>
            Extract the install archive to the chosen installation
            location using your preferred file-compression tool. Some
            tools may extract the archive to a folder within your chosen
            installation location. If this occurs, you can move the
            contents of the subfolder into the chosen installation
            location.
</p></li></ol>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-create-option-file"></a>2.3.5.2 Creating an Option File</h4>

</div>

</div>

</div>
<p>
        If you need to specify startup options when you run the server,
        you can indicate them on the command line or place them in an
        option file. For options that are used every time the server
        starts, you may find it most convenient to use an option file to
        specify your MySQL configuration. This is particularly true
        under the following circumstances:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The installation or data directory locations are different
            from the default locations (<code class="filename">C:\Program
            Files\MySQL\MySQL Server 8.0</code> and
            <code class="filename">C:\Program Files\MySQL\MySQL Server
            8.0\data</code>).
          </p></li><li class="listitem"><p>
            You need to tune the server settings, such as memory, cache,
            or InnoDB configuration information.
</p></li></ul>
</div>
<p>
        When the MySQL server starts on Windows, it looks for option
        files in several locations, such as the Windows directory,
        <code class="filename">C:\</code>, and the MySQL installation directory
        (for the full list of locations, see
        <a class="xref" href="programs.html#option-files" title="4.2.6 Using Option Files">Section 4.2.6, “Using Option Files”</a>). The Windows directory typically
        is named something like <code class="filename">C:\WINDOWS</code>. You can
        determine its exact location from the value of the
        <code class="literal">WINDIR</code> environment variable using the
        following command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>echo %WINDIR%</code></strong>
</pre><p>
        MySQL looks for options in each location first in the
        <code class="filename">my.ini</code> file, and then in the
        <code class="filename">my.cnf</code> file. However, to avoid confusion,
        it is best if you use only one file. If your PC uses a boot
        loader where <code class="filename">C:</code> is not the boot drive, your
        only option is to use the <code class="filename">my.ini</code> file.
        Whichever option file you use, it must be a plain text file.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          When using the MySQL Installer to install MySQL Server, it will create
          the <code class="filename">my.ini</code> at the default location, and
          the user executing MySQL Installer is granted full permissions to this
          new <code class="filename">my.ini</code> file.
        </p><p>
          In other words, be sure that the MySQL Server user has
          permission to read the <code class="filename">my.ini</code> file.
</p>
</div>
<p>
        You can also make use of the example option files included with
        your MySQL distribution; see
        <a class="xref" href="server-administration.html#server-configuration-defaults" title="5.1.2 Server Configuration Defaults">Section 5.1.2, “Server Configuration Defaults”</a>.
      </p><p>
        An option file can be created and modified with any text editor,
        such as Notepad. For example, if MySQL is installed in
        <code class="filename">E:\mysql</code> and the data directory is in
        <code class="filename">E:\mydata\data</code>, you can create an option
        file containing a <code class="literal">[mysqld]</code> section to specify
        values for the <code class="option">basedir</code> and
        <code class="option">datadir</code> options:
      </p><pre data-lang="ini" class="programlisting">
[mysqld]
# set basedir to your installation path
basedir=E:/mysql
# set datadir to the location of your data directory
datadir=E:/mydata/data
</pre><p>
        Microsoft Windows path names are specified in option files using
        (forward) slashes rather than backslashes. If you do use
        backslashes, double them:
      </p><pre data-lang="ini" class="programlisting">
[mysqld]
# set basedir to your installation path
basedir=E:\\mysql
# set datadir to the location of your data directory
datadir=E:\\mydata\\data
</pre><p>
        The rules for use of backslash in option file values are given
        in <a class="xref" href="programs.html#option-files" title="4.2.6 Using Option Files">Section 4.2.6, “Using Option Files”</a>.
      </p><p>
        The ZIP archive does not include a <code class="filename">data</code>
        directory. To initialize a MySQL installation by creating the
        data directory and populating the tables in the mysql system
        database, initialize MySQL using either
        <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
        <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>. For
        additional information, see
        <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a>.
      </p><p>
        If you would like to use a data directory in a different
        location, you should copy the entire contents of the
        <code class="filename">data</code> directory to the new location. For
        example, if you want to use <code class="filename">E:\mydata</code> as
        the data directory instead, you must do two things:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Move the entire <code class="filename">data</code> directory and all
            of its contents from the default location (for example
            <code class="filename">C:\Program Files\MySQL\MySQL Server
            8.0\data</code>) to
            <code class="filename">E:\mydata</code>.
          </p></li><li class="listitem"><p>
            Use a <a class="link" href="server-administration.html#option_mysqld_datadir"><code class="option">--datadir</code></a> option to
            specify the new data directory location each time you start
            the server.
</p></li></ol>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-select-server"></a>2.3.5.3 Selecting a MySQL Server Type</h4>

</div>

</div>

</div>
<p>
        The following table shows the available servers for Windows in
        MySQL 8.0.
</p>
<div class="informaltable">
<table summary="Servers available for Windows in MySQL 8.0."><col width="20%"><col width="80%"><thead><tr>
            <th scope="col">Binary</th>
            <th scope="col">Description</th>
          </tr></thead><tbody><tr>
            <td scope="row"><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a></td>
            <td>Optimized binary with named-pipe support</td>
          </tr><tr>
            <td scope="row"><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld-debug</strong></span></a></td>
            <td>Like <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, but compiled with full debugging and
              automatic memory allocation checking</td>
</tr></tbody></table>
</div>
<p>
        All of the preceding binaries are optimized for modern Intel
        processors, but should work on any Intel i386-class or higher
        processor.
      </p><p>
        Each of the servers in a distribution support the same set of
        storage engines. The <a class="link" href="sql-syntax.html#show-engines" title="13.7.6.16 SHOW ENGINES Syntax"><code class="literal">SHOW ENGINES</code></a>
        statement displays which engines a given server supports.
      </p><p>
        All Windows MySQL 8.0 servers have support for
        symbolic linking of database directories.
      </p><a class="indexterm" name="idm139899658800896"></a><a class="indexterm" name="idm139899658799824"></a><p>
        MySQL supports TCP/IP on all Windows platforms. MySQL servers on
        Windows also support named pipes, if you start the server with
        the <a class="link" href="server-administration.html#option_mysqld_enable-named-pipe"><code class="option">--enable-named-pipe</code></a> option.
        It is necessary to use this option explicitly because some users
        have experienced problems with shutting down the MySQL server
        when named pipes were used. The default is to use TCP/IP
        regardless of platform because named pipes are slower than
        TCP/IP in many Windows configurations.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-initialize-data-directory"></a>2.3.5.4 Initializing the Data Directory</h4>

</div>

</div>

</div>
<p>
        If you installed MySQL using the <code class="literal">noinstall</code>
        package, no data directory is included. To initialize the data
        directory, use the instructions at
        <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-server-first-start"></a>2.3.5.5 Starting the Server for the First Time</h4>

</div>

</div>

</div>
<p>
        This section gives a general overview of starting the MySQL
        server. The following sections provide more specific information
        for starting the MySQL server from the command line or as a
        Windows service.
      </p><p>
        The information here applies primarily if you installed MySQL
        using the <code class="literal">noinstall</code> version, or if you wish
        to configure and test MySQL manually rather than with the GUI
        tools.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The MySQL server will automatically start after using MySQL Installer,
          and <a class="link" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">MySQL Notifier</a> can be
          used to start/stop/restart at any time.
</p>
</div>
<p>
        The examples in these sections assume that MySQL is installed
        under the default location of <code class="filename">C:\Program
        Files\MySQL\MySQL Server 8.0</code>. Adjust the
        path names shown in the examples if you have MySQL installed in
        a different location.
      </p><p>
        Clients have two options. They can use TCP/IP, or they can use a
        named pipe if the server supports named-pipe connections.
      </p><p>
        MySQL for Windows also supports shared-memory connections if the
        server is started with the
        <a class="link" href="server-administration.html#option_mysqld_shared-memory"><code class="option">--shared-memory</code></a> option. Clients
        can connect through shared memory by using the
        <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol=MEMORY</code></a> option.
      </p><p>
        For information about which server binary to run, see
        <a class="xref" href="installing.html#windows-select-server" title="2.3.5.3 Selecting a MySQL Server Type">Section 2.3.5.3, “Selecting a MySQL Server Type”</a>.
      </p><p>
        Testing is best done from a command prompt in a console window
        (or <span class="quote">“<span class="quote">DOS window</span>”</span>). In this way you can have the
        server display status messages in the window where they are easy
        to see. If something is wrong with your configuration, these
        messages make it easier for you to identify and fix any
        problems.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The database must be initialized before MySQL can be started.
          For additional information about the initialization process,
          see <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a>.
</p>
</div>
<p>
        To start the server, enter this command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld" --console</code></strong>
</pre><p>
        For a server that includes <code class="literal">InnoDB</code> support,
        you should see the messages similar to those following as it
        starts (the path names and sizes may differ):
      </p><pre data-lang="none" class="programlisting">
InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
InnoDB: a new database to be created!
InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
InnoDB: Database physically writes the file full: wait...
InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be created
InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: creating foreign key constraint system tables
InnoDB: foreign key constraint system tables created
011024 10:58:25  InnoDB: Started
</pre><p>
        When the server finishes its startup sequence, you should see
        something like this, which indicates that the server is ready to
        service client connections:
      </p><pre data-lang="none" class="programlisting">
mysqld: ready for connections
Version: '8.0.13'  socket: ''  port: 3306
</pre><p>
        The server continues to write to the console any further
        diagnostic output it produces. You can open a new console window
        in which to run client programs.
      </p><p>
        If you omit the <a class="link" href="server-administration.html#option_mysqld_console"><code class="option">--console</code></a> option,
        the server writes diagnostic output to the error log in the data
        directory (<code class="filename">C:\Program Files\MySQL\MySQL Server
        8.0\data</code> by default). The error log is
        the file with the <code class="filename">.err</code> extension, and may
        be set using the <a class="link" href="server-administration.html#option_mysqld_log-error"><code class="option">--log-error</code></a>
        option.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The initial <code class="literal">root</code> account in the MySQL grant
          tables has no password. After starting the server, you should
          set up a password for it using the instructions in
          <a class="xref" href="installing.html#default-privileges" title="2.10.4 Securing the Initial MySQL Account">Section 2.10.4, “Securing the Initial MySQL Account”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-start-command-line"></a>2.3.5.6 Starting MySQL from the Windows Command Line</h4>

</div>

</div>

</div>
<p>
        The MySQL server can be started manually from the command line.
        This can be done on any version of Windows.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          <a class="link" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">MySQL Notifier</a> can also
          be used to start/stop/restart the MySQL server.
</p>
</div>
<p>
        To start the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server from the command
        line, you should start a console window (or <span class="quote">“<span class="quote">DOS
        window</span>”</span>) and enter this command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"</code></strong>
</pre><p>
        The path to <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> may vary depending on the
        install location of MySQL on your system.
      </p><p>
        You can stop the MySQL server by executing this command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" -u root shutdown</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          If the MySQL <code class="literal">root</code> user account has a
          password, you need to invoke <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>
          with the <code class="option">-p</code> option and supply the password
          when prompted.
</p>
</div>
<p>
        This command invokes the MySQL administrative utility
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> to connect to the server and tell
        it to shut down. The command connects as the MySQL
        <code class="literal">root</code> user, which is the default
        administrative account in the MySQL grant system.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Users in the MySQL grant system are wholly independent from
          any login users under Microsoft Windows.
</p>
</div>
<p>
        If <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> doesn't start, check the error log
        to see whether the server wrote any messages there to indicate
        the cause of the problem. By default, the error log is located
        in the <code class="filename">C:\Program Files\MySQL\MySQL Server
        8.0\data</code> directory. It is the file with
        a suffix of <code class="filename">.err</code>, or may be specified by
        passing in the <a class="link" href="server-administration.html#option_mysqld_log-error"><code class="option">--log-error</code></a>
        option. Alternatively, you can try to start the server with the
        <a class="link" href="server-administration.html#option_mysqld_console"><code class="option">--console</code></a> option; in this case,
        the server may display some useful information on the screen
        that will help solve the problem.
      </p><p>
        The last option is to start <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with the
        <a class="link" href="server-administration.html#option_mysqld_standalone"><code class="option">--standalone</code></a> and
        <a class="link" href="server-administration.html#option_mysqld_debug"><code class="option">--debug</code></a> options. In this case,
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> writes a log file
        <code class="filename">C:\mysqld.trace</code> that should contain the
        reason why <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> doesn't start. See
        <a class="xref" href="extending-mysql.html#dbug-package" title="28.5.3 The DBUG Package">Section 28.5.3, “The DBUG Package”</a>.
      </p><p>
        Use <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld --verbose --help</strong></span></a> to display all
        the options that <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> supports.
</p>
</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-installation-windows-path"></a>2.3.5.7 Customizing the PATH for MySQL Tools</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899658730160"></a><a class="indexterm" name="idm139899658729072"></a>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
          You must exercise great care when editing your system
          <code class="literal">PATH</code> by hand; accidental deletion or
          modification of any portion of the existing
          <code class="literal">PATH</code> value can leave you with a
          malfunctioning or even unusable system.
</p>
</div>
<p>
        To make it easier to invoke MySQL programs, you can add the path
        name of the MySQL <code class="filename">bin</code> directory to your
        Windows system <code class="literal">PATH</code> environment variable:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            On the Windows desktop, right-click the <span class="guiicon">My
            Computer</span> icon, and select
            <span class="guimenuitem">Properties</span>.
          </p></li><li class="listitem"><p>
            Next select the <span class="guimenuitem">Advanced</span> tab from
            the <span class="guimenu">System Properties</span> menu that appears,
            and click the <span class="guibutton">Environment Variables</span>
            button.
          </p></li><li class="listitem"><p>
            Under <span class="guilabel">System Variables</span>, select
            <span class="guimenuitem">Path</span>, and then click the
            <span class="guibutton">Edit</span> button. The <span class="guimenu">Edit System
            Variable</span> dialogue should appear.
          </p></li><li class="listitem"><p>
            Place your cursor at the end of the text appearing in the
            space marked <span class="guilabel">Variable Value</span>. (Use the
            <span class="keycap"><strong>End</strong></span> key to ensure that your cursor is
            positioned at the very end of the text in this space.) Then
            enter the complete path name of your MySQL
            <code class="filename">bin</code> directory (for example,
            <code class="literal">C:\Program Files\MySQL\MySQL Server
            8.0\bin</code>)
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              There must be a semicolon separating this path from any
              values present in this field.
</p>
</div>
<p>
            Dismiss this dialogue, and each dialogue in turn, by
            clicking <span class="guibutton">OK</span> until all of the
            dialogues that were opened have been dismissed. The new
            <code class="literal">PATH</code> value should now be available to any
            new command shell you open, allowing you to invoke any MySQL
            executable program by typing its name at the DOS prompt from
            any directory on the system, without having to supply the
            path. This includes the servers, the
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client, and all MySQL command-line
            utilities such as <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> and
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>.
</p></li></ul>
</div>
<p>
        You should not add the MySQL <code class="filename">bin</code> directory
        to your Windows <code class="literal">PATH</code> if you are running
        multiple MySQL servers on the same machine.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-start-service"></a>2.3.5.8 Starting MySQL as a Windows Service</h4>

</div>

</div>

</div>
<p>
        On Windows, the recommended way to run MySQL is to install it as
        a Windows service, so that MySQL starts and stops automatically
        when Windows starts and stops. A MySQL server installed as a
        service can also be controlled from the command line using
        <span class="command"><strong>NET</strong></span> commands, or with the graphical
        <span class="command"><strong>Services</strong></span> utility. Generally, to install MySQL
        as a Windows service you should be logged in using an account
        that has administrator rights.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          <a class="link" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">MySQL Notifier</a> can also
          be used to monitor the status of the MySQL service.
</p>
</div>
<p>
        The <span class="command"><strong>Services</strong></span> utility (the Windows
        <span class="command"><strong>Service Control Manager</strong></span>) can be found in the
        Windows Control Panel (under <span class="guimenuitem">Administrative
        Tools</span> on Windows Vista, and Server 2003). To avoid
        conflicts, it is advisable to close the
        <span class="command"><strong>Services</strong></span> utility while performing server
        installation or removal operations from the command line.
</p>
<h5><a name="idm139899658692224"></a>Installing the service</h5>
<p>
        Before installing MySQL as a Windows service, you should first
        stop the current server if it is running by using the following
        command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin"</code></strong>
          <strong class="userinput"><code>-u root shutdown</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          If the MySQL <code class="literal">root</code> user account has a
          password, you need to invoke <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>
          with the <code class="option">-p</code> option and supply the password
          when prompted.
</p>
</div>
<p>
        This command invokes the MySQL administrative utility
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> to connect to the server and tell
        it to shut down. The command connects as the MySQL
        <code class="literal">root</code> user, which is the default
        administrative account in the MySQL grant system.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Users in the MySQL grant system are wholly independent from
          any login users under Windows.
</p>
</div>
<p>
        Install the server as a service using this command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld" --install</code></strong>
</pre><p>
        The service-installation command does not start the server.
        Instructions for that are given later in this section.
      </p><p>
        To make it easier to invoke MySQL programs, you can add the path
        name of the MySQL <code class="filename">bin</code> directory to your
        Windows system <code class="literal">PATH</code> environment variable:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            On the Windows desktop, right-click the <span class="guiicon">My
            Computer</span> icon, and select
            <span class="guimenuitem">Properties</span>.
          </p></li><li class="listitem"><p>
            Next select the <span class="guimenuitem">Advanced</span> tab from
            the <span class="guimenu">System Properties</span> menu that appears,
            and click the <span class="guibutton">Environment Variables</span>
            button.
          </p></li><li class="listitem"><p>
            Under <span class="guilabel">System Variables</span>, select
            <span class="guimenuitem">Path</span>, and then click the
            <span class="guibutton">Edit</span> button. The <span class="guimenu">Edit System
            Variable</span> dialogue should appear.
          </p></li><li class="listitem"><p>
            Place your cursor at the end of the text appearing in the
            space marked <span class="guilabel">Variable Value</span>. (Use the
            <span class="keycap"><strong>End</strong></span> key to ensure that your cursor is
            positioned at the very end of the text in this space.) Then
            enter the complete path name of your MySQL
            <code class="filename">bin</code> directory (for example,
            <code class="literal">C:\Program Files\MySQL\MySQL Server
            8.0\bin</code>), and there should be a
            semicolon separating this path from any values present in
            this field. Dismiss this dialogue, and each dialogue in
            turn, by clicking <span class="guibutton">OK</span> until all of the
            dialogues that were opened have been dismissed. You should
            now be able to invoke any MySQL executable program by typing
            its name at the DOS prompt from any directory on the system,
            without having to supply the path. This includes the
            servers, the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client, and all MySQL
            command-line utilities such as <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>
            and <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>.
          </p><p>
            You should not add the MySQL <code class="filename">bin</code>
            directory to your Windows <code class="literal">PATH</code> if you are
            running multiple MySQL servers on the same machine.
</p></li></ul>
</div>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
          You must exercise great care when editing your system
          <code class="literal">PATH</code> by hand; accidental deletion or
          modification of any portion of the existing
          <code class="literal">PATH</code> value can leave you with a
          malfunctioning or even unusable system.
</p>
</div>
<p>
        The following additional arguments can be used when installing
        the service:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            You can specify a service name immediately following the
            <code class="option">--install</code> option. The default service name
            is <code class="literal">MySQL</code>.
          </p></li><li class="listitem"><p>
            If a service name is given, it can be followed by a single
            option. By convention, this should be
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
            to specify the name of an option file from which the server
            should read options when it starts.
          </p><p>
            The use of a single option other than
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> is possible
            but discouraged.
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> is more
            flexible because it enables you to specify multiple startup
            options for the server by placing them in the named option
            file.
          </p></li><li class="listitem"><p>
            You can also specify a <code class="option">--local-service</code>
            option following the service name. This causes the server to
            run using the <code class="literal">LocalService</code> Windows
            account that has limited system privileges. If both
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> and
            <code class="option">--local-service</code> are given following the
            service name, they can be in any order.
</p></li></ul>
</div>
<p>
        For a MySQL server that is installed as a Windows service, the
        following rules determine the service name and option files that
        the server uses:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            If the service-installation command specifies no service
            name or the default service name (<code class="literal">MySQL</code>)
            following the <code class="option">--install</code> option, the server
            uses the service name of <code class="literal">MySQL</code> and reads
            options from the <code class="literal">[mysqld]</code> group in the
            standard option files.
          </p></li><li class="listitem"><p>
            If the service-installation command specifies a service name
            other than <code class="literal">MySQL</code> following the
            <code class="option">--install</code> option, the server uses that
            service name. It reads options from the
            <code class="literal">[mysqld]</code> group and the group that has the
            same name as the service in the standard option files. This
            enables you to use the <code class="literal">[mysqld]</code> group for
            options that should be used by all MySQL services, and an
            option group with the service name for use by the server
            installed with that service name.
          </p></li><li class="listitem"><p>
            If the service-installation command specifies a
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> option after
            the service name, the server reads options the same way as
            described in the previous item, except that it reads options
            only from the named file and ignores the standard option
            files.
</p></li></ul>
</div>
<p>
        As a more complex example, consider the following command:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"</code></strong>
          <strong class="userinput"><code>--install MySQL --defaults-file=C:\my-opts.cnf</code></strong>
</pre><p>
        Here, the default service name (<code class="literal">MySQL</code>) is
        given after the <code class="option">--install</code> option. If no
        <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> option had been
        given, this command would have the effect of causing the server
        to read the <code class="literal">[mysqld]</code> group from the standard
        option files. However, because the
        <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> option is
        present, the server reads options from the
        <code class="literal">[mysqld]</code> option group, and only from the
        named file.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          On Windows, if the server is started with the
          <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> and
          <a class="link" href="server-administration.html#option_mysqld_install"><code class="option">--install</code></a> options,
          <a class="link" href="server-administration.html#option_mysqld_install"><code class="option">--install</code></a> must be first.
          Otherwise, <code class="literal">mysqld.exe</code> will attempt to start
          the MySQL server.
</p>
</div>
<p>
        You can also specify options as Start parameters in the Windows
        <span class="command"><strong>Services</strong></span> utility before you start the MySQL
        service.
      </p><p>
        Finally, before trying to start the MySQL service, make sure the
        user variables <code class="literal">%TEMP%</code> and
        <code class="literal">%TMP%</code> (and also <code class="literal">%TMPDIR%</code>,
        if it has ever been set) for the system user who is to run the
        service are pointing to a folder to which the user has write
        access. The default user for running the MySQL service is
        <code class="literal">LocalSystem</code>, and the default value for its
        <code class="literal">%TEMP%</code> and <code class="literal">%TMP%</code> is
        <code class="filename">C:\Windows\Temp</code>, a directory
        <code class="literal">LocalSystem</code> has write access to by default.
        However, if there are any changes to that default setup (for
        example, changes to the user who runs the service or to the
        mentioned user variables, or the
        <a class="link" href="server-administration.html#option_mysqld_tmpdir"><code class="option">--tmpdir</code></a> option has been used to
        put the temporary directory somewhere else), the MySQL service
        might fail to run because write access to the temporary
        directory has not been granted to the proper user.
</p>
<h5><a name="idm139899658610192"></a>Starting the service</h5>
<p>
        After a MySQL server instance has been installed as a service,
        Windows starts the service automatically whenever Windows
        starts. The service also can be started immediately from the
        <span class="command"><strong>Services</strong></span> utility, or by using a <span class="command"><strong>NET
        START MySQL</strong></span> command. The <span class="command"><strong>NET</strong></span>
        command is not case-sensitive.
      </p><p>
        When run as a service, <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> has no access
        to a console window, so no messages can be seen there. If
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> does not start, check the error log to
        see whether the server wrote any messages there to indicate the
        cause of the problem. The error log is located in the MySQL data
        directory (for example, <code class="filename">C:\Program Files\MySQL\MySQL
        Server 8.0\data</code>). It is the file with a
        suffix of <code class="filename">.err</code>.
      </p><p>
        When a MySQL server has been installed as a service, and the
        service is running, Windows stops the service automatically when
        Windows shuts down. The server also can be stopped manually by
        using the <code class="literal">Services</code> utility, the <span class="command"><strong>NET
        STOP MySQL</strong></span> command, or the <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin
        shutdown</strong></span></a> command.
      </p><p>
        You also have the choice of installing the server as a manual
        service if you do not wish for the service to be started
        automatically during the boot process. To do this, use the
        <code class="option">--install-manual</code> option rather than the
        <code class="option">--install</code> option:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld" --install-manual</code></strong>
</pre>
<h5><a name="idm139899658595488"></a>Removing the service</h5>
<p>
        To remove a server that is installed as a service, first stop it
        if it is running by executing <span class="command"><strong>NET STOP MySQL</strong></span>.
        Then use the <a class="link" href="server-administration.html#option_mysqld_remove"><code class="option">--remove</code></a> option to
        remove it:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld" --remove</code></strong>
</pre><p>
        If <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is not running as a service, you
        can start it from the command line. For instructions, see
        <a class="xref" href="installing.html#windows-start-command-line" title="2.3.5.6 Starting MySQL from the Windows Command Line">Section 2.3.5.6, “Starting MySQL from the Windows Command Line”</a>.
      </p><p>
        If you encounter difficulties during installation, see
        <a class="xref" href="installing.html#windows-troubleshooting" title="2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation">Section 2.3.6, “Troubleshooting a Microsoft Windows MySQL Server Installation”</a>.
      </p><p>
        For more information about stopping or removing a MySQL Windows
        service, see <a class="xref" href="server-administration.html#multiple-windows-services" title="5.7.2.2 Starting Multiple MySQL Instances as Windows Services">Section 5.7.2.2, “Starting Multiple MySQL Instances as Windows Services”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="windows-testing"></a>2.3.5.9 Testing The MySQL Installation</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899658584224"></a><a class="indexterm" name="idm139899658583184"></a><p>
        You can test whether the MySQL server is working by executing
        any of the following commands:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqlshow"</code></strong>
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqlshow" -u root mysql</code></strong>
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" version status proc</code></strong>
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" test</code></strong>
</pre><p>
        If <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is slow to respond to TCP/IP
        connections from client programs, there is probably a problem
        with your DNS. In this case, start <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
        with the <a class="link" href="server-administration.html#option_mysqld_skip-name-resolve"><code class="option">--skip-name-resolve</code></a>
        option and use only <code class="literal">localhost</code> and IP
        addresses in the <code class="literal">Host</code> column of the MySQL
        grant tables. (Be sure that an account exists that specifies an
        IP address or you may not be able to connect.)
      </p><p>
        You can force a MySQL client to use a named-pipe connection
        rather than TCP/IP by specifying the
        <a class="link" href="programs.html#option_general_pipe"><code class="option">--pipe</code></a> or
        <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol=PIPE</code></a> option, or by
        specifying <code class="literal">.</code> (period) as the host name. Use
        the <a class="link" href="programs.html#option_general_socket"><code class="option">--socket</code></a> option to specify
        the name of the pipe if you do not want to use the default pipe
        name.
      </p><p>
        If you have set a password for the <code class="literal">root</code>
        account, deleted the anonymous account, or created a new user
        account, then to connect to the MySQL server you must use the
        appropriate <code class="option">-u</code> and <code class="option">-p</code> options
        with the commands shown previously. See
        <a class="xref" href="programs.html#connecting" title="4.2.2 Connecting to the MySQL Server">Section 4.2.2, “Connecting to the MySQL Server”</a>.
      </p><p>
        For more information about <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>, see
        <a class="xref" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information">Section 4.5.8, “<span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-troubleshooting"></a>2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation</h3>

</div>

</div>

</div>
<p>
      When installing and running MySQL for the first time, you may
      encounter certain errors that prevent the MySQL server from
      starting. This section helps you diagnose and correct some of
      these errors.
    </p><p>
      Your first resource when troubleshooting server issues is the
      <a class="link" href="glossary.html#glos_error_log" title="error log">error log</a>. The MySQL server
      uses the error log to record information relevant to the error
      that prevents the server from starting. The error log is located
      in the <a class="link" href="glossary.html#glos_data_directory" title="data directory">data directory</a>
      specified in your <code class="filename">my.ini</code> file. The default
      data directory location is <code class="filename">C:\Program Files\MySQL\MySQL
      Server 8.0\data</code>, or
      <code class="filename">C:\ProgramData\Mysql</code> on Windows 7 and Windows
      Server 2008. The <code class="filename">C:\ProgramData</code> directory is
      hidden by default. You need to change your folder options to see
      the directory and contents. For more information on the error log
      and understanding the content, see <a class="xref" href="server-administration.html#error-log" title="5.4.2 The Error Log">Section 5.4.2, “The Error Log”</a>.
    </p><p>
      For information regarding possible errors, also consult the
      console messages displayed when the MySQL service is starting. Use
      the <span class="command"><strong>NET START MySQL</strong></span> command from the command
      line after installing <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> as a service to
      see any error messages regarding the starting of the MySQL server
      as a service. See <a class="xref" href="installing.html#windows-start-service" title="2.3.5.8 Starting MySQL as a Windows Service">Section 2.3.5.8, “Starting MySQL as a Windows Service”</a>.
    </p><p>
      The following examples show other common error messages you might
      encounter when installing MySQL and starting the server for the
      first time:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If the MySQL server cannot find the <code class="literal">mysql</code>
          privileges database or other critical files, it displays these
          messages:
        </p><pre data-lang="none" class="programlisting">
System error 1067 has occurred.
Fatal error: Can't open and lock privilege tables:
Table 'mysql.user' doesn't exist
</pre><p>
          These messages often occur when the MySQL base or data
          directories are installed in different locations than the
          default locations (<code class="filename">C:\Program Files\MySQL\MySQL
          Server 8.0</code> and <code class="filename">C:\Program
          Files\MySQL\MySQL Server 8.0\data</code>,
          respectively).
        </p><p>
          This situation can occur when MySQL is upgraded and installed
          to a new location, but the configuration file is not updated
          to reflect the new location. In addition, old and new
          configuration files might conflict. Be sure to delete or
          rename any old configuration files when upgrading MySQL.
        </p><p>
          If you have installed MySQL to a directory other than
          <code class="filename">C:\Program Files\MySQL\MySQL Server
          8.0</code>, ensure that the MySQL server is
          aware of this through the use of a configuration
          (<code class="filename">my.ini</code>) file. Put the
          <code class="filename">my.ini</code> file in your Windows directory,
          typically <code class="filename">C:\WINDOWS</code>. To determine its
          exact location from the value of the <code class="literal">WINDIR</code>
          environment variable, issue the following command from the
          command prompt:
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>echo %WINDIR%</code></strong>
</pre><p>
          You can create or modify an option file with any text editor,
          such as Notepad. For example, if MySQL is installed in
          <code class="filename">E:\mysql</code> and the data directory is
          <code class="filename">D:\MySQLdata</code>, you can create the option
          file and set up a <code class="literal">[mysqld]</code> section to
          specify values for the <code class="option">basedir</code> and
          <code class="option">datadir</code> options:
        </p><pre data-lang="ini" class="programlisting">
[mysqld]
# set basedir to your installation path
basedir=E:/mysql
# set datadir to the location of your data directory
datadir=D:/MySQLdata
</pre><p>
          Microsoft Windows path names are specified in option files
          using (forward) slashes rather than backslashes. If you do use
          backslashes, double them:
        </p><pre data-lang="ini" class="programlisting">
[mysqld]
# set basedir to your installation path
basedir=C:\\Program Files\\MySQL\\MySQL Server 8.0
# set datadir to the location of your data directory
datadir=D:\\MySQLdata
</pre><p>
          The rules for use of backslash in option file values are given
          in <a class="xref" href="programs.html#option-files" title="4.2.6 Using Option Files">Section 4.2.6, “Using Option Files”</a>.
        </p><p>
          If you change the <code class="option">datadir</code> value in your MySQL
          configuration file, you must move the contents of the existing
          MySQL data directory before restarting the MySQL server.
        </p><p>
          See <a class="xref" href="installing.html#windows-create-option-file" title="2.3.5.2 Creating an Option File">Section 2.3.5.2, “Creating an Option File”</a>.
        </p></li><li class="listitem"><p>
          If you reinstall or upgrade MySQL without first stopping and
          removing the existing MySQL service and install MySQL using
          the MySQL Installer, you might see this error:
        </p><pre data-lang="none" class="programlisting">
Error: Cannot create Windows service for MySql. Error: 0
</pre><p>
          This occurs when the Configuration Wizard tries to install the
          service and finds an existing service with the same name.
        </p><p>
          One solution to this problem is to choose a service name other
          than <code class="literal">mysql</code> when using the configuration
          wizard. This enables the new service to be installed
          correctly, but leaves the outdated service in place. Although
          this is harmless, it is best to remove old services that are
          no longer in use.
        </p><p>
          To permanently remove the old <code class="literal">mysql</code>
          service, execute the following command as a user with
          administrative privileges, on the command line:
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>sc delete mysql</code></strong>
[SC] DeleteService SUCCESS
</pre><p>
          If the <code class="literal">sc</code> utility is not available for your
          version of Windows, download the <code class="literal">delsrv</code>
          utility from
          <a class="ulink" href="http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/delsrv-o.asp" target="_top">http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/delsrv-o.asp</a>
          and use the <code class="literal">delsrv mysql</code> syntax.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-postinstallation"></a>2.3.7 Windows Postinstallation Procedures</h3>

</div>

</div>

</div>
<p>
      GUI tools exist that perform most of the tasks described in this
      section, including:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">MySQL Installer</a>: Used to install
          and upgrade MySQL products.
        </p></li><li class="listitem"><p>
          <a class="link" href="workbench.html" title="Chapter 30 MySQL Workbench">MySQL Workbench</a>: Manages the
          MySQL server and edits SQL statements.
        </p></li><li class="listitem"><p>
          <a class="link" href="installing.html#windows-notifier" title="2.3.4 MySQL Notifier">MySQL Notifier</a>:
          Starts, stops, or restarts the MySQL server, and monitors its
          status.
        </p></li><li class="listitem"><p>
          <a class="ulink" href="http://dev.mysql.com/doc/mysql-for-excel/en/" target="_top">MySQL for Excel</a>: Edits
          MySQL data with Microsoft Excel.
</p></li></ul>
</div>
<p>
      If necessary, initialize the data directory and create the MySQL
      grant tables. Windows installation operations performed by MySQL Installer
      initialize the data directory automatically. For installation from
      a ZIP Archive package, you can initialize the data directory as
      described at
      <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a>.
    </p><p>
      Regarding passwords, if you installed MySQL using the MySQL Installer, you
      may have already assigned a passwords to the initial
      <code class="literal">root</code> account. (See
      <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>.) Otherwise, use the
      password-assignment procedure given in
      <a class="xref" href="installing.html#default-privileges" title="2.10.4 Securing the Initial MySQL Account">Section 2.10.4, “Securing the Initial MySQL Account”</a>.
    </p><p>
      Before assigning passwords, you might want to try running some
      client programs to make sure that you can connect to the server
      and that it is operating properly. Make sure that the server is
      running (see <a class="xref" href="installing.html#windows-server-first-start" title="2.3.5.5 Starting the Server for the First Time">Section 2.3.5.5, “Starting the Server for the First Time”</a>). You
      can also set up a MySQL service that runs automatically when
      Windows starts (see <a class="xref" href="installing.html#windows-start-service" title="2.3.5.8 Starting MySQL as a Windows Service">Section 2.3.5.8, “Starting MySQL as a Windows Service”</a>).
    </p><p>
      These instructions assume that your current location is the MySQL
      installation directory and that it has a <code class="filename">bin</code>
      subdirectory containing the MySQL programs used here. If that is
      not true, adjust the command path names accordingly.
    </p><p>
      If you installed MySQL using MySQL Installer (see
      <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>), the default installation
      directory is <code class="filename">C:\Program Files\MySQL\MySQL Server
      8.0</code>:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>cd "C:\Program Files\MySQL\MySQL Server 8.0"</code></strong>
</pre><p>
      A common installation location for installation from a ZIP archive
      is <code class="filename">C:\mysql</code>:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>cd C:\mysql</code></strong>
</pre><a class="indexterm" name="idm139899658494688"></a><a class="indexterm" name="idm139899658493600"></a><p>
      Alternatively, add the <code class="filename">bin</code> directory to your
      <code class="literal">PATH</code> environment variable setting. That enables
      your command interpreter to find MySQL programs properly, so that
      you can run a program by typing only its name, not its path name.
      See <a class="xref" href="installing.html#mysql-installation-windows-path" title="2.3.5.7 Customizing the PATH for MySQL Tools">Section 2.3.5.7, “Customizing the PATH for MySQL Tools”</a>.
    </p><p>
      With the server running, issue the following commands to verify
      that you can retrieve information from the server. The output
      should be similar to that shown here.
    </p><p>
      Use <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> to see what databases exist:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>bin\mysqlshow</code></strong>
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
</pre><p>
      The list of installed databases may vary, but will always include
      the minimum of <code class="literal">mysql</code> and
      <code class="literal">information_schema</code>.
    </p><p>
      The preceding command (and commands for other MySQL programs such
      as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a>) may not work if the correct MySQL
      account does not exist. For example, the program may fail with an
      error, or you may not be able to view all databases. If you
      installed MySQL using MySQL Installer, the <code class="literal">root</code> user will
      have been created automatically with the password you supplied. In
      this case, you should use the <code class="option">-u root</code> and
      <code class="option">-p</code> options. (You must use those options if you
      have already secured the initial MySQL accounts.) With
      <code class="option">-p</code>, the client program prompts for the
      <code class="literal">root</code> password. For example:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>bin\mysqlshow -u root -p</code></strong>
Enter password: <em class="replaceable"><code>(enter root password here)</code></em>
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
</pre><p>
      If you specify a database name, <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>
      displays a list of the tables within the database:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>bin\mysqlshow mysql</code></strong>
Database: mysql
+---------------------------+
|          Tables           |
+---------------------------+
| columns_priv              |
| db                        |
| engine_cost               |
| event                     |
| func                      |
| general_log               |
| gtid_executed             |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| innodb_index_stats        |
| innodb_table_stats        |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| server_cost               |
| servers                   |
| slave_master_info         |
| slave_relay_log_info      |
| slave_worker_info         |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
</pre><p>
      Use the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> program to select information
      from a table in the <code class="literal">mysql</code> database:
    </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>bin\mysql -e "SELECT User, Host, plugin FROM mysql.user" mysql</code></strong>
+------+-----------+-----------------------+
| User | Host      | plugin                |
+------+-----------+-----------------------+
| root | localhost | caching_sha2_password |
+------+-----------+-----------------------+
</pre><p>
      For more information about <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> and
      <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>, see <a class="xref" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool">Section 4.5.1, “<span class="command"><strong>mysql</strong></span> — The MySQL Command-Line Tool”</a>, and
      <a class="xref" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information">Section 4.5.8, “<span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="windows-upgrading"></a>2.3.8 Upgrading MySQL on Windows</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899658461712"></a><p>
      There are two approaches for upgrading MySQL on Windows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Using MySQL Installer
        </p></li><li class="listitem"><p>
          Using the Windows ZIP archive distribution
</p></li></ul>
</div>
<p>
      The approach you select depends on how the existing installation
      was performed. Before proceeding, review
      <a class="xref" href="installing.html#upgrading" title="2.11.1 Upgrading MySQL">Section 2.11.1, “Upgrading MySQL”</a> for additional information on
      upgrading MySQL that is not specific to Windows.
    </p><p>
      Upgrades between milestone releases (or from a milestone release
      to a GA release) are not supported. Significant development
      changes take place in milestone releases and you may encounter
      compatibility issues or problems starting the server.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="windows-upgrading-installer"></a>Upgrading MySQL with MySQL Installer</h4>
</div>
</div>
</div>
<p>
        Performing an upgrade with MySQL Installer is the best approach when the
        current server installation was performed with it and the
        upgrade is within the current release series. MySQL Installer does not
        support upgrades between release series, such as from
        5.7 to 8.0, and it does not provide
        an upgrade indicator to prompt you to upgrade. For instruction
        on upgrading between release series, see
        <a class="xref" href="installing.html#windows-upgrading-zip-distribution" title="Upgrading MySQL Using the Windows ZIP Distribution">Upgrading MySQL Using the Windows ZIP Distribution</a>.
      </p><p>
        To perform an upgrade using MySQL Installer:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Start MySQL Installer.
          </p></li><li class="listitem"><p>
            From the dashboard, click <span class="guilabel">Catalog</span> to
            download the latest changes to the catalog. The installed
            server can be upgraded only if the dashboard displays an
            arrow next to the version number of the server.
          </p></li><li class="listitem"><p>
            Click <span class="guilabel">Upgrade</span>. All products that have
            newer versions will appear in a list.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              For server milestone releases in the same release series,
              MySQL Installer deselects the server upgrade and displays a warning
              to indicate that the upgrade is not supported, identifies
              the risks of continuing, and provides a summary of the
              steps to perform an upgrade manually. You can reselect
              server upgrade and proceed at your own risk.
</p>
</div>
</li><li class="listitem"><p>
            Deselect all but the MySQL server product, unless you intend
            to upgrade other products at this time, and click
            <span class="guibutton">Next</span>.
          </p></li><li class="listitem"><p>
            Click <span class="guibutton">Execute</span> to start the download.
            When the download finishes, click
            <span class="guibutton">Next</span> to apply the updates.
          </p></li><li class="listitem"><p>
            Configure the server.
</p></li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="windows-upgrading-zip-distribution"></a>Upgrading MySQL Using the Windows ZIP Distribution</h4>

</div>

</div>

</div>
<p>
        To perform an upgrade using the Windows ZIP archive
        distribution:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Always back up your current MySQL installation before
            performing an upgrade. See <a class="xref" href="backup-and-recovery.html#backup-methods" title="7.2 Database Backup Methods">Section 7.2, “Database Backup Methods”</a>.
          </p></li><li class="listitem"><p>
            Download the latest Windows ZIP Archive distribution of
            MySQL from <a class="ulink" href="http://dev.mysql.com/downloads/" target="_top">http://dev.mysql.com/downloads/</a>.
          </p></li><li class="listitem"><p>
            Before upgrading MySQL, stop the server. If the server is
            installed as a service, stop the service with the following
            command from the command prompt:
          </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>NET STOP MySQL</code></strong>
</pre><p>
            If you are not running the MySQL server as a service, use
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> to stop it. For example,
            before upgrading from MySQL 5.7 to
            8.0, use <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> from
            MySQL 5.7 as follows:
          </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin" -u root shutdown</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              If the MySQL <code class="literal">root</code> user account has a
              password, invoke <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> with the
              <code class="option">-p</code> option and enter the password when
              prompted.
</p>
</div>
</li><li class="listitem"><p>
            Extract the ZIP archive. You may either overwrite your
            existing MySQL installation (usually located at
            <code class="filename">C:\mysql</code>), or install it into a
            different directory, such as <code class="literal">C:\mysql8</code>.
            Overwriting the existing installation is recommended.
          </p></li><li class="listitem"><p>
            If you were running MySQL as a Windows service and you had
            to remove the service earlier in this procedure, reinstall
            the service. (See <a class="xref" href="installing.html#windows-start-service" title="2.3.5.8 Starting MySQL as a Windows Service">Section 2.3.5.8, “Starting MySQL as a Windows Service”</a>.)
          </p></li><li class="listitem"><p>
            Restart the server. For example, use <span class="command"><strong>NET START
            MySQL</strong></span> if you run MySQL as a service, or invoke
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> directly otherwise.
          </p></li><li class="listitem"><p>
            As Administrator, run <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> to
            check your tables, attempt to repair them if necessary, and
            update your grant tables if they have changed so that you
            can take advantage of any new capabilities. See
            <a class="xref" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables">Section 4.4.5, “<span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables”</a>.
          </p></li><li class="listitem"><p>
            If you encounter errors, see
            <a class="xref" href="installing.html#windows-troubleshooting" title="2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation">Section 2.3.6, “Troubleshooting a Microsoft Windows MySQL Server Installation”</a>.
</p></li></ol>
</div>

</div>

</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="deploy-mysql-nonlinux-docker"></a>2.3.9 Deploying MySQL on Windows and Other Non-Linux Platforms</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899658411728"></a>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
        The MySQL Docker images provided by Oracle are built
        specifically for Linux platforms. Other platforms are not
        supported, and users running the MySQL Docker images from Oracle
        on them are doing so at their own risk. This section discusses
        some known issues for the images when used on non-Linux
        platforms.
</p>
</div>
<p>
      Known Issues for using the MySQL Server Docker images from Oracle
      on Windows include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If you are bind-mounting on the container's MySQL data
          directory (see
          <a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a> for
          details), you have to set the location of the server socket
          file with the <a class="link" href="server-administration.html#sysvar_socket"><code class="option">--socket</code></a> option
          to somewhere outside of the MySQL data directory; otherwise,
          the server will fail to start. This is because the way Docker
          for Windows handles file mounting does not allow a host file
          from being bind-mounted on the socket file.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="osx-installation"></a>2.4 Installing MySQL on macOS</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#osx-installation-notes">2.4.1 General Notes on Installing MySQL on macOS</a></span></dt><dt><span class="section"><a href="installing.html#osx-installation-pkg">2.4.2 Installing MySQL on macOS Using Native Packages</a></span></dt><dt><span class="section"><a href="installing.html#osx-installation-launchd">2.4.3 Installing and Using the MySQL Launch Daemon</a></span></dt><dt><span class="section"><a href="installing.html#osx-installation-prefpane">2.4.4 Installing and Using the MySQL Preference Pane</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899658403664"></a><a class="indexterm" name="idm139899658402208"></a><p>
    For a list of macOS versions that the MySQL server supports, see
    <a class="ulink" href="http://www.mysql.com/support/supportedplatforms/database.html" target="_top">http://www.mysql.com/support/supportedplatforms/database.html</a>.
  </p><p>
    MySQL for macOS is available in a number of different forms:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        Native Package Installer, which uses the native macOS installer
        (DMG) to walk you through the installation of MySQL. For more
        information, see <a class="xref" href="installing.html#osx-installation-pkg" title="2.4.2 Installing MySQL on macOS Using Native Packages">Section 2.4.2, “Installing MySQL on macOS Using Native Packages”</a>. You can
        use the package installer with macOS. The user you use to
        perform the installation must have administrator privileges.
      </p></li><li class="listitem"><p>
        Compressed TAR archive, which uses a file packaged using the
        Unix <span class="command"><strong>tar</strong></span> and <span class="command"><strong>gzip</strong></span>
        commands. To use this method, you will need to open a
        <span class="command"><strong>Terminal</strong></span> window. You do not need
        administrator privileges using this method, as you can install
        the MySQL server anywhere using this method. For more
        information on using this method, you can use the generic
        instructions for using a tarball,
        <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
      </p><p>
        In addition to the core installation, the Package Installer also
        includes <a class="xref" href="installing.html#osx-installation-launchd" title="2.4.3 Installing and Using the MySQL Launch Daemon">Section 2.4.3, “Installing and Using the MySQL Launch Daemon”</a> and
        <a class="xref" href="installing.html#osx-installation-prefpane" title="2.4.4 Installing and Using the MySQL Preference Pane">Section 2.4.4, “Installing and Using the MySQL Preference Pane”</a> to simplify the
        management of your installation.
</p></li></ul>
</div>
<p>
    For additional information on using MySQL on macOS, see
    <a class="xref" href="installing.html#osx-installation-notes" title="2.4.1 General Notes on Installing MySQL on macOS">Section 2.4.1, “General Notes on Installing MySQL on macOS”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="osx-installation-notes"></a>2.4.1 General Notes on Installing MySQL on macOS</h3>
</div>
</div>
</div>
<p>
      You should keep the following issues and notes in mind:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <span class="bold"><strong>Other MySQL installations</strong></span>:
          The installation procedure does not recognize MySQL
          installations by package managers such as Homebrew. The
          installation and upgrade process is for MySQL packages
          provided by us. If other installations are present, then
          consider stopping them before executing this installer to
          avoid port conflicts.
        </p><p>
          <span class="bold"><strong>Homebrew</strong></span>: For example, if you
          installed MySQL Server using Homebrew to its default location
          then the MySQL installer installs to a different location and
          won't upgrade the version from Homebrew. In this scenario you
          would end up with multiple MySQL installations that, by
          default, attempt to use the same ports. Stop the other MySQL
          Server instances before running this installer, such as
          executing <span class="emphasis"><em>brew services stop mysql</em></span> to
          stop the Homebrew's MySQL service.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Launchd</strong></span>: A launchd daemon is
          installed that alters MySQL configuration options. Consider
          editing it if needed, see the documentation below for
          additional information. Also, macOS 10.10 removed startup item
          support in favor of launchd daemons. The optional MySQL
          preference pane under macOS <span class="guilabel">System
          Preferences</span> uses the launchd daemon.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Users</strong></span>: You may need (or want)
          to create a specific <code class="literal">mysql</code> user to own the
          MySQL directory and data. You can do this through the
          <span class="command"><strong>Directory Utility</strong></span>, and the
          <code class="literal">mysql</code> user should already exist. For use in
          single user mode, an entry for <code class="literal">_mysql</code> (note
          the underscore prefix) should already exist within the system
          <code class="filename">/etc/passwd</code> file.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Data</strong></span>: Because the MySQL
          package installer installs the MySQL contents into a version
          and platform specific directory, you can use this to upgrade
          and migrate your database between versions. You will need to
          either copy the <code class="filename">data</code> directory from the
          old version to the new version, or alternatively specify an
          alternative <code class="option">datadir</code> value to set location of
          the data directory. By default, the MySQL directories are
          installed under <code class="filename">/usr/local/</code>.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Aliases</strong></span>: You might want to
          add aliases to your shell's resource file to make it easier to
          access commonly used programs such as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a>
          and <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> from the command line. The
          syntax for <span class="command"><strong>bash</strong></span> is:
        </p><pre data-lang="terminal" class="programlisting">
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
</pre><p>
          For <span class="command"><strong>tcsh</strong></span>, use:
        </p><pre data-lang="terminal" class="programlisting">
alias mysql /usr/local/mysql/bin/mysql
alias mysqladmin /usr/local/mysql/bin/mysqladmin
</pre><p>
          Even better, add <code class="literal">/usr/local/mysql/bin</code> to
          your <code class="literal">PATH</code> environment variable. You can do
          this by modifying the appropriate startup file for your shell.
          For more information, see <a class="xref" href="programs.html#invoking-programs" title="4.2.1 Invoking MySQL Programs">Section 4.2.1, “Invoking MySQL Programs”</a>.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Removing</strong></span>: After you have
          copied over the MySQL database files from the previous
          installation and have successfully started the new server, you
          should consider removing the old installation files to save
          disk space. Additionally, you should also remove older
          versions of the Package Receipt directories located in
          <code class="filename">/Library/Receipts/mysql-<em class="replaceable"><code>VERSION</code></em>.pkg</code>.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Legacy</strong></span>: Prior to OS X 10.7,
          MySQL server was bundled with OS X Server.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="osx-installation-pkg"></a>2.4.2 Installing MySQL on macOS Using Native Packages</h3>

</div>

</div>

</div>
<p>
      The package is located inside a disk image
      (<code class="literal">.dmg</code>) file that you first need to mount by
      double-clicking its icon in the Finder. It should then mount the
      image and display its contents.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        Before proceeding with the installation, be sure to stop all
        running MySQL server instances by using either the MySQL Manager
        Application (on macOS Server), the preference pane, or
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin shutdown</strong></span></a> on the command line.
</p>
</div>
<p>
      To install MySQL using the package installer:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Download the disk image (<code class="filename">.dmg</code>) file (the
          community version is available
          <a class="ulink" href="http://dev.mysql.com/downloads/mysql/" target="_top">here</a>) that
          contains the MySQL package installer. Double-click the file to
          mount the disk image and see its contents.
        </p><p>
          Double-click the MySQL installer package from the disk. It is
          named according to the version of MySQL you have downloaded.
          For example, for MySQL server 8.0.13 it might be
          named
          <code class="filename">mysql-8.0.13-osx-<em class="replaceable"><code>10.13-x86_64</code></em>.pkg</code>.
        </p></li><li class="listitem"><p>
          The initial wizard introduction screen references the MySQL
          server version to install. Click
          <span class="guibutton">Continue</span> to begin the installation.
        </p><p>
          The MySQL community edition shows a copy of the relevant GNU
          General Public License. Click <span class="guibutton">Continue</span>
          and then <span class="guibutton">Agree</span> to continue.
        </p></li><li class="listitem"><p>
          From the <span class="guilabel">Installation Type</span> page you can
          either click <span class="guibutton">Install</span> to execute the
          installation wizard using all defaults, click
          <span class="guibutton">Customize</span> to alter which components to
          install (MySQL server, MySQL Test, Preference Pane, Launchd
          Support -- all but MySQL Test are enabled by default).
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Although the <span class="guibutton">Change Install Location</span>
            option is visible, the installation location cannot be
            changed.
</p>
</div>

<div class="figure">
<a name="mac-installer-installation-type-main"></a><p class="title"><b>Figure 2.20 MySQL Package Installer Wizard: Installation Type</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-installation-type-standard.png" width="621" height="438" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break">
<div class="figure">
<a name="mac-installer-installation-customize-main"></a><p class="title"><b>Figure 2.21 MySQL Package Installer Wizard: Customize</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-installation-type-customize.png" width="622" height="439" alt="Customize shows three package name options: MySQL Server, MySQL Test, Preference Pane, and Launchd Support. All three options are checked.">
</div>

</div>

</div>
<br class="figure-break"></li><li class="listitem"><p>
          Click <span class="guibutton">Install</span> to install MySQL Server.
          The installation process ends here if upgrading a current
          MySQL Server installation, otherwise follow the wizard's
          additional configuration steps for your new MySQL Server
          installation.
        </p></li><li class="listitem"><p>
          After a successful new MySQL Server installation, complete the
          configuration steps by choosing the default encryption type
          for passwords, define the root password, and also enable (or
          disable) MySQL server at startup.
        </p></li><li class="listitem"><p>
          The default MySQL 8.0 password mechanism is
          <code class="literal">caching_sha2_password</code> (Strong), and this
          step allows you to change it to
          <code class="literal">mysql_native_password</code> (Legacy).
</p>
<div class="figure">
<a name="mac-installer-installation-encryption-type"></a><p class="title"><b>Figure 2.22 MySQL Package Installer Wizard: Choose a Password Encryption Type</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-configuration-password-type.png" width="621" height="438" alt='Most content is described in the surrounding text. The installer refers to caching_sha2_password as "Use Strong Password Encryption" and mysql_native_password as a "Use Legacy Password Encryption".'>
</div>

</div>

</div>
<br class="figure-break"><p>
          Choosing the legacy password mechanism alters the generated
          launchd file to set
          <code class="literal">--default_authentication_plugin=mysql_native_password</code>
          under <code class="literal">ProgramArguments</code>. Choosing strong
          password encryption does not set
          <code class="literal">--default_authentication_plugin</code> because the
          default MySQL Server value is used, which is
          <code class="literal">caching_sha2_password</code>.
        </p></li><li class="listitem"><p>
          Define a password for the root user, and also toggle whether
          MySQL Server should start after the configuration step is
          complete.
</p>
<div class="figure">
<a name="mac-installer-installation-root-pass"></a><p class="title"><b>Figure 2.23 MySQL Package Installer Wizard: Define Root Password</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-configuration-password-define.png" width="621" height="438" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"></li><li class="listitem"><p>
          <span class="guilabel">Summary</span> is the final step and references
          a successful and complete MySQL Server installation.
          <span class="guibutton">Close</span> the wizard.
</p>
<div class="figure">
<a name="mac-installer-installation-summary"></a><p class="title"><b>Figure 2.24 MySQL Package Installer Wizard: Summary</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-summary.png" width="621" height="438" alt="Shows that the installation was a success, and includes links to the MySQL manual, mysql.com, and oracle.com.">
</div>

</div>

</div>
<br class="figure-break"></li></ol>
</div>
<p>
      MySQL server is now installed. If you chose to not start MySQL,
      then use either launchctl from the command line or start MySQL by
      clicking "Start" using the MySQL preference pane. For additional
      information, see <a class="xref" href="installing.html#osx-installation-launchd" title="2.4.3 Installing and Using the MySQL Launch Daemon">Section 2.4.3, “Installing and Using the MySQL Launch Daemon”</a>, and
      <a class="xref" href="installing.html#osx-installation-prefpane" title="2.4.4 Installing and Using the MySQL Preference Pane">Section 2.4.4, “Installing and Using the MySQL Preference Pane”</a>. Use the MySQL
      Preference Pane or launchd to configure MySQL to automatically
      start at bootup.
    </p><p>
      When installing using the package installer, the files are
      installed into a directory within <code class="filename">/usr/local</code>
      matching the name of the installation version and platform. For
      example, the installer file
      <code class="filename">mysql-8.0.13-<em class="replaceable"><code>osx10.13-x86_64.dmg</code></em></code>
      installs MySQL into
      <code class="filename">/usr/local/mysql-8.0.13-osx10.13-x86_64/
      </code> with a symlink to
      <code class="filename">/usr/local/mysql</code>. The following table shows
      the layout of this MySQL installation directory.
</p>
<div class="table">
<a name="mysql-installation-layout-osx"></a><p class="title"><b>Table 2.6 MySQL Installation Layout on macOS</b></p>
<div class="table-contents">
<table><col width="45%"><col width="55%"><thead><tr>
          <th scope="col">Directory</th>
          <th scope="col">Contents of Directory</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="filename">bin</code></td>
          <td><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server, client and utility programs</td>
        </tr><tr>
          <td scope="row"><code class="filename">data</code></td>
          <td>Log files, databases, where
            <code class="filename">/usr/local/mysql/data/mysqld.local.err</code>
            is the default error log</td>
        </tr><tr>
          <td scope="row"><code class="filename">docs</code></td>
          <td>Helper documents, like the Release Notes and build information</td>
        </tr><tr>
          <td scope="row"><code class="filename">include</code></td>
          <td>Include (header) files</td>
        </tr><tr>
          <td scope="row"><code class="filename">lib</code></td>
          <td>Libraries</td>
        </tr><tr>
          <td scope="row"><code class="filename">man</code></td>
          <td>Unix manual pages</td>
        </tr><tr>
          <td scope="row"><code class="filename">mysql-test</code></td>
          <td>MySQL test suite ('MySQL Test' is disabled by default during the
            installation process when using the installer package (DMG))</td>
        </tr><tr>
          <td scope="row"><code class="filename">share</code></td>
          <td>Miscellaneous support files, including error messages, sample
            configuration files, SQL for database installation</td>
        </tr><tr>
          <td scope="row"><code class="filename">support-files</code></td>
          <td>Scripts and sample configuration files</td>
        </tr><tr>
          <td scope="row"><code class="filename">/tmp/mysql.sock</code></td>
          <td>Location of the MySQL Unix socket</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="osx-installation-launchd"></a>2.4.3 Installing and Using the MySQL Launch Daemon</h3>

</div>

</div>

</div>
<p>
      macOS uses launch daemons to automatically start, stop, and manage
      processes and applications such as MySQL.
    </p><p>
      By default, the installation package (DMG) on macOS installs a
      launchd file named
      <code class="filename">/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist</code>
      that contains a plist definition similar to:
    </p><pre data-lang="terminal" class="programlisting">

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;             &lt;string&gt;com.oracle.oss.mysql.mysqld&lt;/string&gt;
    &lt;key&gt;ProcessType&lt;/key&gt;       &lt;string&gt;Interactive&lt;/string&gt;
    &lt;key&gt;Disabled&lt;/key&gt;          &lt;false/&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;         &lt;true/&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;         &lt;true/&gt;
    &lt;key&gt;SessionCreate&lt;/key&gt;     &lt;true/&gt;
    &lt;key&gt;LaunchOnlyOnce&lt;/key&gt;    &lt;false/&gt;
    &lt;key&gt;UserName&lt;/key&gt;          &lt;string&gt;_mysql&lt;/string&gt;
    &lt;key&gt;GroupName&lt;/key&gt;         &lt;string&gt;_mysql&lt;/string&gt;
    &lt;key&gt;ExitTimeOut&lt;/key&gt;       &lt;integer&gt;600&lt;/integer&gt;
    &lt;key&gt;Program&lt;/key&gt;           &lt;string&gt;/usr/local/mysql/bin/mysqld&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
            &lt;string&gt;/usr/local/mysql/bin/mysqld&lt;/string&gt;
            &lt;string&gt;--user=_mysql&lt;/string&gt;
            &lt;string&gt;--basedir=/usr/local/mysql&lt;/string&gt;
            &lt;string&gt;--datadir=/usr/local/mysql/data&lt;/string&gt;
            &lt;string&gt;--plugin-dir=/usr/local/mysql/lib/plugin&lt;/string&gt;
            &lt;string&gt;--log-error=/usr/local/mysql/data/mysqld.local.err&lt;/string&gt;
            &lt;string&gt;--pid-file=/usr/local/mysql/data/mysqld.local.pid&lt;/string&gt;
            &lt;string&gt;--keyring-file-data=/usr/local/mysql/keyring/keyring&lt;/string&gt;
            &lt;string&gt;--early-plugin-load=keyring_file=keyring_file.so&lt;/string&gt;
        &lt;/array&gt;
    &lt;key&gt;WorkingDirectory&lt;/key&gt;  &lt;string&gt;/usr/local/mysql&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;

</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        Some users report that adding a plist DOCTYPE declaration causes
        the launchd operation to fail, despite it passing the lint
        check. We suspect it's a copy-n-paste error. The md5 checksum of
        a file containing the above snippet is
        <span class="emphasis"><em>d925f05f6d1b6ee5ce5451b596d6baed</em></span>.
</p>
</div>
<p>
      To enable the launchd service, you can either:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Open macOS system preferences and select the MySQL preference
          panel, and then execute <span class="guibutton">Start MySQL
          Server</span>.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-location-launchd"></a><p class="title"><b>Figure 2.25 MySQL Preference Pane: Location</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-preference-pane-location.png" width="668" height="598" alt='Shows "MySQL" typed into the macOS System Preferences search box, and a highlighted "MySQL" icon in the bottom left.'>
</div>

</div>

</div>
<br class="figure-break"><p>
          The <span class="guilabel">Instances</span> page includes an option to
          start or stop MySQL, and <span class="guibutton">Initialize
          Database</span> recreates the <code class="filename">data/</code>
          directory. <span class="guibutton">Uninstall</span> uninstalls MySQL
          Server and optionally the MySQL preference panel and launchd
          information.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-instances-launchd"></a><p class="title"><b>Figure 2.26 MySQL Preference Pane: Instances</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-preference-pane-instances.png" width="668" height="548" alt='The left side shows a list of MySQL instances separated by "Active Instance", "Installed Instances", and "Data Directories" sections. The right side shows a "Stop MySQL Server" button, a checkbox titled "Start MySQL when your computer starts up", and "Initialize Database" and "Uninstall" buttons. Several fields reference 8.0.11 as the current installed MySQL version.'>
</div>

</div>

</div>
<br class="figure-break"></li><li class="listitem"><p>
          Or, manually load the launchd file.
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; cd /Library/LaunchDaemons
shell&gt; sudo launchctl load -F com.oracle.oss.mysql.mysqld.plist
        </pre></li><li class="listitem"><p>
          To configure MySQL to automatically start at bootup, you can:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; sudo launchctl load -w com.oracle.oss.mysql.mysqld.plist
</pre></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
        When upgrading MySQL server, the launchd installation process
        will remove the old startup items that were installed with MySQL
        server 5.7.7 and below.
      </p><p>
        Also, upgrading will replace your existing launchd file named
        <code class="filename">com.oracle.oss.mysql.mysqld.plist</code>.
</p>
</div>
<p>
      Additional launchd related information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The plist entries override <code class="filename">my.cnf</code>
          entries, because they are passed in as command line arguments.
          For additional information about passing in program options,
          see <a class="xref" href="programs.html#program-options" title="4.2.3 Specifying Program Options">Section 4.2.3, “Specifying Program Options”</a>.
        </p></li><li class="listitem"><p>
          The <span class="bold"><strong>ProgramArguments</strong></span> section
          defines the command line options that are passed into the
          program, which is the <code class="filename">mysqld</code> binary in
          this case.
        </p></li><li class="listitem"><p>
          The default plist definition is written with less
          sophisticated use cases in mind. For more complicated setups,
          you may want to remove some of the arguments and instead rely
          on a MySQL configuration file, such as
          <code class="filename">my.cnf</code>.
        </p></li><li class="listitem"><p>
          If you edit the plist file, then uncheck the installer option
          when reinstalling or upgrading MySQL. Otherwise, your edited
          plist file will be overwritten, and all edits will be lost.
</p></li></ul>
</div>
<p>
      Because the default plist definition defines several
      <span class="bold"><strong>ProgramArguments</strong></span>, you might
      remove most of these arguments and instead rely upon your
      <code class="filename">my.cnf</code> MySQL configuration file to define
      them. For example:
    </p><pre data-lang="terminal" class="programlisting">

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;             &lt;string&gt;com.oracle.oss.mysql.mysqld&lt;/string&gt;
    &lt;key&gt;ProcessType&lt;/key&gt;       &lt;string&gt;Interactive&lt;/string&gt;
    &lt;key&gt;Disabled&lt;/key&gt;          &lt;false/&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;         &lt;true/&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;         &lt;true/&gt;
    &lt;key&gt;SessionCreate&lt;/key&gt;     &lt;true/&gt;
    &lt;key&gt;LaunchOnlyOnce&lt;/key&gt;    &lt;false/&gt;
    &lt;key&gt;UserName&lt;/key&gt;          &lt;string&gt;_mysql&lt;/string&gt;
    &lt;key&gt;GroupName&lt;/key&gt;         &lt;string&gt;_mysql&lt;/string&gt;
    &lt;key&gt;ExitTimeOut&lt;/key&gt;       &lt;integer&gt;600&lt;/integer&gt;
    &lt;key&gt;Program&lt;/key&gt;           &lt;string&gt;/usr/local/mysql/bin/mysqld&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
            &lt;string&gt;/usr/local/mysql/bin/mysqld&lt;/string&gt;
            &lt;string&gt;--user=_mysql&lt;/string&gt;
            &lt;string&gt;--basedir=/usr/local/mysql&lt;/string&gt;
            &lt;string&gt;--datadir=/usr/local/mysql/data&lt;/string&gt;
            &lt;string&gt;--plugin-dir=/usr/local/mysql/lib/plugin&lt;/string&gt;
            &lt;string&gt;--log-error=/usr/local/mysql/data/mysqld.local.err&lt;/string&gt;
            &lt;string&gt;--pid-file=/usr/local/mysql/data/mysqld.local.pid&lt;/string&gt;
            &lt;string&gt;--keyring-file-data=/usr/local/mysql/keyring/keyring&lt;/string&gt;
            &lt;string&gt;--early-plugin-load=keyring_file=keyring_file.so&lt;/string&gt;
        &lt;/array&gt;
    &lt;key&gt;WorkingDirectory&lt;/key&gt;  &lt;string&gt;/usr/local/mysql&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;

   </pre><p>
      In this case, the <a class="link" href="server-administration.html#sysvar_basedir"><code class="literal">basedir</code></a>,
      <a class="link" href="server-administration.html#sysvar_datadir"><code class="literal">datadir</code></a>,
      <a class="link" href="server-administration.html#sysvar_plugin_dir"><code class="literal">plugin_dir</code></a>,
      <a class="link" href="server-administration.html#sysvar_log_error"><code class="literal">log_error</code></a>,
      <a class="link" href="server-administration.html#sysvar_pid_file"><code class="literal">pid_file</code></a>,
      <a class="link" href="security.html#sysvar_keyring_file_data"><code class="literal">keyring_file_data</code></a>, and
      ﻿<a class="link" href="server-administration.html#option_mysqld_early-plugin-load"><code class="option">--early-plugin-load</code></a> options were
      removed from the default plist
      <span class="emphasis"><em>ProgramArguments</em></span> definition, which you might
      have defined in <code class="filename">my.cnf</code> instead.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="osx-installation-prefpane"></a>2.4.4 Installing and Using the MySQL Preference Pane</h3>

</div>

</div>

</div>
<p>
      The MySQL Installation Package includes a MySQL preference pane
      that enables you to start, stop, and control automated startup
      during boot of your MySQL installation.
    </p><p>
      This preference pane is installed by default, and is listed under
      your system's <span class="emphasis"><em>System Preferences</em></span> window.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-location-initial"></a><p class="title"><b>Figure 2.27 MySQL Preference Pane: Location</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-preference-pane-location.png" width="668" height="598" alt='Shows "MySQL" typed into the macOS System Preferences search box, and a highlighted "MySQL" icon in the bottom left.'>
</div>

</div>

</div>
<br class="figure-break"><p>
      The MySQL preference pane is installed with the same DMG file that
      installs MySQL Server. Typically it is installed with MySQL Server
      but it can be installed by itself too.
    </p><p>
      To install the MySQL preference pane:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Go through the process of installing the MySQL server, as
          described in the documentation at
          <a class="xref" href="installing.html#osx-installation-pkg" title="2.4.2 Installing MySQL on macOS Using Native Packages">Section 2.4.2, “Installing MySQL on macOS Using Native Packages”</a>.
        </p></li><li class="listitem"><p>
          Click <span class="guibutton">Customize</span> at the
          <span class="guilabel">Installation Type</span> step. The "Preference
          Pane" option is listed there and enabled by default; make sure
          it is not deselected. The other options, such as MySQL Server,
          can be selected or deslected.
</p>
<div class="figure">
<a name="mac-installer-installation-customize-pane"></a><p class="title"><b>Figure 2.28 MySQL Package Installer Wizard: Customize</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-installation-type-customize.png" width="622" height="439" alt="Customize shows three package name options: MySQL Server, MySQL Test, Preference Pane, and Launchd Support. All three options are checked.">
</div>

</div>

</div>
<br class="figure-break"></li><li class="listitem"><p>
          Complete the installation process.
</p></li></ol>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
        The MySQL preference pane only starts and stops MySQL
        installation installed from the MySQL package installation that
        have been installed in the default location.
</p>
</div>
<p>
      Once the MySQL preference pane has been installed, you can control
      your MySQL server instance using this preference pane.
    </p><p>
      The <span class="guilabel">Instances</span> page includes an option to
      start and stop MySQL, and <span class="guibutton">Initialize
      Database</span> recreates the <code class="filename">data/</code>
      directory. <span class="guibutton">Uninstall</span> uninstalls MySQL
      Server and optionally the pain and launchd information.
    </p><p>
      The <span class="guilabel">Instances</span> page includes an option to
      start or stop MySQL, and <span class="guibutton">Initialize
      Database</span> recreates the <code class="filename">data/</code>
      directory. <span class="guibutton">Uninstall</span> uninstalls MySQL
      Server and optionally the MySQL preference panel and launchd
      information.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-instances-instances"></a><p class="title"><b>Figure 2.29 MySQL Preference Pane: Instances</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-preference-pane-instances.png" width="668" height="548" alt='The left side shows a list of MySQL instances separated by "Active Instance", "Installed Instances", and "Data Directories" sections. The right side shows a "Stop MySQL Server" button, a checkbox titled "Start MySQL when your computer starts up", and "Initialize Database" and "Uninstall" buttons. Several fields reference 8.0.11 as the current installed MySQL version.'>
</div>

</div>

</div>
<br class="figure-break"><p>
      The <span class="guilabel">Configuration</span> page shows MySQL Server
      options including the path to the MySQL configuration file.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-configuration"></a><p class="title"><b>Figure 2.30 MySQL Preference Pane: Configuration</b></p>
<div class="figure-contents">

<div class="mediaobject">
<img src="images/mac-installer-preference-pane-configuration.png" width="668" height="548" alt="Content is described in the surrounding text.">
</div>

</div>

</div>
<br class="figure-break"><p>
      The MySQL Preference Pane shows the current status of the MySQL
      server, showing <span class="guilabel">stopped</span> (in red) if the
      server is not running and <span class="guilabel">running</span> (in green)
      if the server has already been started. The preference pane also
      shows the current setting for whether the MySQL server has been
      set to start automatically.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="linux-installation"></a>2.5 Installing MySQL on Linux</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#linux-installation-yum-repo">2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-apt-repo">2.5.2 Installing MySQL on Linux Using the MySQL APT Repository</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-sles-repo">2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-rpm">2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-debian">2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-docker">2.5.6 Deploying MySQL on Linux with Docker</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-native">2.5.7 Installing MySQL on Linux from the Native Software Repositories</a></span></dt><dt><span class="section"><a href="installing.html#linux-installation-juju">2.5.8 Installing MySQL on Linux with Juju</a></span></dt><dt><span class="section"><a href="installing.html#using-systemd">2.5.9 Managing MySQL Server with systemd</a></span></dt></dl>
</div>
<p>
    Linux supports a number of different solutions for installing MySQL.
    We recommend that you use one of the distributions from Oracle, for
    which several methods for installation are available:
</p>
<div class="table">
<a name="linux-installation-methods"></a><p class="title"><b>Table 2.7 Linux Installation Methods and Information</b></p>
<div class="table-contents">
<table><col width="30%"><col width="30%"><col width="40%"><thead><tr>
        <th scope="col">Type</th>
        <th scope="col">Setup Method</th>
        <th scope="col">Additional Information</th>
      </tr></thead><tbody><tr>
        <td scope="row">Apt</td>
        <td>Enable the <a class="ulink" href="http://dev.mysql.com/downloads/repo/apt/" target="_top">MySQL Apt
          repository</a></td>
        <td><a class="link" href="installing.html#linux-installation-apt-repo" title="2.5.2 Installing MySQL on Linux Using the MySQL APT Repository">Documentation</a></td>
      </tr><tr>
        <td scope="row">Yum</td>
        <td>Enable the <a class="ulink" href="http://dev.mysql.com/downloads/repo/yum/" target="_top">MySQL Yum
          repository</a></td>
        <td><a class="link" href="installing.html#linux-installation-yum-repo" title="2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository">Documentation</a></td>
      </tr><tr>
        <td scope="row">Zypper</td>
        <td>Enable the <a class="ulink" href="http://dev.mysql.com/downloads/repo/suse/" target="_top">MySQL SLES
          repository</a></td>
        <td><a class="link" href="installing.html#linux-installation-sles-repo" title="2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository">Documentation</a></td>
      </tr><tr>
        <td scope="row">RPM</td>
        <td><a class="ulink" href="http://dev.mysql.com/downloads/mysql/" target="_top">Download</a> a specific
          package</td>
        <td><a class="link" href="installing.html#linux-installation-rpm" title="2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle">Documentation</a></td>
      </tr><tr>
        <td scope="row">DEB</td>
        <td><a class="ulink" href="http://dev.mysql.com/downloads/mysql/" target="_top">Download</a> a specific
          package</td>
        <td><a class="link" href="installing.html#linux-installation-debian" title="2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle">Documentation</a></td>
      </tr><tr>
        <td scope="row">Generic</td>
        <td><a class="ulink" href="http://dev.mysql.com/downloads/mysql/" target="_top">Download</a> a generic
          package</td>
        <td><a class="link" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Documentation</a></td>
      </tr><tr>
        <td scope="row">Source</td>
        <td>Compile from <a class="ulink" href="http://dev.mysql.com/downloads/mysql/" target="_top">source</a></td>
        <td><a class="link" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Documentation</a></td>
      </tr><tr>
        <td scope="row">Docker</td>
        <td>Use Docker Hub</td>
        <td><a class="link" href="installing.html#linux-installation-docker" title="2.5.6 Deploying MySQL on Linux with Docker">Documentation</a></td>
      </tr><tr>
        <td scope="row">Oracle Unbreakable Linux Network</td>
        <td>Use ULN channels</td>
        <td><a class="link" href="installing.html#uln-installation" title="2.6 Installing MySQL Using Unbreakable Linux Network (ULN)">Documentation</a></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
    As an alternative, you can use the package manager on your system to
    automatically download and install MySQL with packages from the
    native software repositories of your Linux distribution. These
    native packages are often several versions behind the currently
    available release. You will also normally be unable to install
    development milestone releases (DMRs), as these are not usually made
    available in the native repositories. For more information on using
    the native package installers, see
    <a class="xref" href="installing.html#linux-installation-native" title="2.5.7 Installing MySQL on Linux from the Native Software Repositories">Section 2.5.7, “Installing MySQL on Linux from the Native Software Repositories”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      For many Linux installations, you will want to set up MySQL to be
      started automatically when your machine starts. Many of the native
      package installations perform this operation for you, but for
      source, binary and RPM solutions you may need to set this up
      separately. The required script, <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a>,
      can be found in the <code class="filename">support-files</code> directory
      under the MySQL installation directory or in a MySQL source tree.
      You can install it as <code class="filename">/etc/init.d/mysql</code> for
      automatic MySQL startup and shutdown. See
      <a class="xref" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script">Section 4.3.3, “<span class="command"><strong>mysql.server</strong></span> — MySQL Server Startup Script”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-yum-repo"></a>2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899658085600"></a><a class="indexterm" name="idm139899658084528"></a><p>
      The <a class="ulink" href="http://dev.mysql.com/downloads/repo/yum/" target="_top">MySQL Yum
      repository</a> for Oracle Linux, Red Hat Enterprise Linux,
      CentOS, and Fedora provides RPM packages for installing the MySQL
      server, client, MySQL Workbench, MySQL Utilities, MySQL Router,
      MySQL Shell, Connector/ODBC, Connector/Python and so on (not all
      packages are available for all the distributions; see
      <a class="xref" href="installing.html#yum-install-components" title="Installing Additional MySQL Products and Components with Yum">Installing Additional MySQL Products and Components with Yum</a> for details).
</p>
<h4><a name="idm139899658081216"></a>Before You Start</h4>
<p>
      As a popular, open-source software, MySQL, in its original or
      re-packaged form, is widely installed on many systems from various
      sources, including different software download sites, software
      repositories, and so on. The following instructions assume that
      MySQL is not already installed on your system using a
      third-party-distributed RPM package; if that is not the case,
      follow the instructions given in
      <a class="xref" href="installing.html#updating-yum-repo" title="2.11.1.3 Upgrading MySQL with the MySQL Yum Repository">Section 2.11.1.3, “Upgrading MySQL with the MySQL Yum Repository”</a> or
      <a class="ulink" href="http://dev.mysql.com/doc/refman/5.7/en/replace-third-party-yum.html" target="_top">Replacing a Third-Party Distribution of MySQL Using the MySQL Yum Repository</a>.
</p>
<h4><a name="idm139899658078000"></a>Steps for a Fresh Installation of MySQL</h4>
<p>
      Follow the steps below to install the latest GA version of MySQL
      with the MySQL Yum repository:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem">
<h4><a name="yum-repo-setup"></a>Adding the MySQL Yum Repository</h4>
<p>
          First, add the MySQL Yum repository to your system's
          repository list. This is a one-time operation, which can be
          performed by installing an RPM provided by MySQL. Follow these
          steps:

</p>
<div class="orderedlist">
<ol class="orderedlist" type="a"><li class="listitem"><p>
                Go to the Download MySQL Yum Repository page
                (<a class="ulink" href="http://dev.mysql.com/downloads/repo/yum/" target="_top">http://dev.mysql.com/downloads/repo/yum/</a>)
                in the MySQL Developer Zone.
              </p></li><li class="listitem"><p>
                Select and download the release package for your
                platform.
              </p></li><li class="listitem"><p>
                Install the downloaded release package with the
                following command, replacing
                <em class="replaceable"><code>platform-and-version-specific-package-name</code></em>
                with the name of the downloaded RPM package:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum localinstall <em class="replaceable"><code>platform-and-version-specific-package-name</code></em>.rpm</code></strong>
</pre><p>
              </p><p>
                For an EL6-based system, the command is in the form of:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum localinstall mysql57-community-release-el6-<em class="replaceable"><code>{version-number}</code></em>.noarch.rpm</code></strong>
</pre><p>
              </p><p>
                For an EL7-based system:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum localinstall mysql57-community-release-el7-<em class="replaceable"><code>{version-number}</code></em>.noarch.rpm</code></strong>
</pre><p>
              </p><p>
                For Fedora 26:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo dnf localinstall mysql57-community-release-fc26-<em class="replaceable"><code>{version-number}</code></em>.noarch.rpm</code></strong>
</pre><p>
              </p><p>
                For Fedora 27:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo dnf localinstall mysql57-community-release-fc27-<em class="replaceable"><code>{version-number}</code></em>.noarch.rpm</code></strong>
</pre><p>
              </p><p>
                The installation command adds the MySQL Yum repository
                to your system's repository list and downloads the GnuPG
                key to check the integrity of the software packages. See
                <a class="xref" href="installing.html#checking-gpg-signature" title="2.1.3.2 Signature Checking Using GnuPG">Section 2.1.3.2, “Signature Checking Using GnuPG”</a> for details on
                GnuPG key checking.
              </p><p>
                You can check that the MySQL Yum repository has been
                successfully added by the following command (for
                dnf-enabled systems, replace <span class="command"><strong>yum</strong></span> in
                the command with <span class="command"><strong>dnf</strong></span>):

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>yum repolist enabled | grep "mysql.*-community.*"</code></strong>
</pre><p>
</p></li></ol>
</div>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Once the MySQL Yum repository is enabled on your system, any
            system-wide update by the <span class="command"><strong>yum update</strong></span>
            command (or <span class="command"><strong>dnf upgrade</strong></span> for dnf-enabled
            systems) will upgrade MySQL packages on your system and also
            replace any native third-party packages, if Yum finds
            replacements for them in the MySQL Yum repository; see
            <a class="xref" href="installing.html#updating-yum-repo" title="2.11.1.3 Upgrading MySQL with the MySQL Yum Repository">Section 2.11.1.3, “Upgrading MySQL with the MySQL Yum Repository”</a> and, for a discussion on
            some possible effects of that on your system, see
            <a class="xref" href="installing.html#updating-yum-repo-client-lib" title="Upgrading the Shared Client Libraries">Upgrading the Shared Client Libraries</a>.
</p>
</div>
</li><li class="listitem">
<h4><a name="yum-repo-select-series"></a>Selecting a Release Series</h4>
<p>
          When using the MySQL Yum repository, the latest GA series
          (currently MySQL 5.7) is selected for installation by default.
          If this is what you want, you can skip to the next step,
          <a class="xref" href="installing.html#yum-repo-installing-mysql" title="Installing MySQL">Installing MySQL</a>.
        </p><p>
          Within the MySQL Yum repository, different release series of
          the MySQL Community Server are hosted in different
          subrepositories. The subrepository for the latest GA series
          (currently MySQL 5.7) is enabled by default, and the
          subrepositories for all other series (for example, the MySQL
          8.0 series) are disabled by default. Use this command to see
          all the subrepositories in the MySQL Yum repository, and see
          which of them are enabled or disabled (for dnf-enabled
          systems, replace <span class="command"><strong>yum</strong></span> in the command with
          <span class="command"><strong>dnf</strong></span>):

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>yum repolist all | grep mysql</code></strong>
</pre><p>
        </p><p>
          To install the latest release from the latest GA series, no
          configuration is needed. To install the latest release from a
          specific series other than the latest GA series, disable the
          subrepository for the latest GA series and enable the
          subrepository for the specific series before running the
          installation command. If your platform supports
          <span class="command"><strong>yum-config-manager</strong></span>, you can do that by
          issuing these commands, which disable the subrepository for
          the 5.7 series and enable the one for the 8.0 series:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum-config-manager --disable mysql57-community</code></strong>
shell&gt; <strong class="userinput"><code>sudo yum-config-manager --enable mysql80-community</code></strong>
</pre><p>

          For dnf-enabled platforms:

</p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo dnf config-manager --disable mysql57-community</code></strong>
shell&gt; <strong class="userinput"><code>sudo dnf config-manager --enable mysql80-community</code></strong>
</pre><p>
        </p><p>
          Besides using <span class="command"><strong>yum-config-manager</strong></span> or the
          <span class="command"><strong>dnf config-manager</strong></span> command, you can also
          select a release series by editing manually the
          <code class="filename">/etc/yum.repos.d/mysql-community.repo</code>
          file. This is a typical entry for a release series'
          subrepository in the file:

</p><pre data-lang="ini" class="programlisting">
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
</pre><p>

          Find the entry for the subrepository you want to configure,
          and edit the <code class="option">enabled</code> option. Specify
          <code class="option">enabled=0</code> to disable a subrepository, or
          <code class="option">enabled=1</code> to enable a subrepository. For
          example, to install MySQL 8.0, make sure you have
          <code class="option">enabled=0</code> for the above subrepository entry
          for MySQL 5.7, and have <code class="option">enabled=1</code> for the
          entry for the 8.0 series:
        </p><pre data-lang="ini" class="programlisting">
# Enable to use MySQL 8.0
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
</pre><p>
          You should only enable subrepository for one release series at
          any time. When subrepositories for more than one release
          series are enabled, the latest series will be used by Yum.
        </p><p>
          Verify that the correct subrepositories have been enabled and
          disabled by running the following command and checking its
          output (for dnf-enabled systems, replace
          <span class="command"><strong>yum</strong></span> in the command with
          <span class="command"><strong>dnf</strong></span>):
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>yum repolist enabled | grep mysql</code></strong>
</pre></li><li class="listitem">
<h4><a name="yum-repo-installing-mysql"></a>Installing MySQL</h4>
<p>
          Install MySQL by the following command (for dnf-enabled
          systems, replace <span class="command"><strong>yum</strong></span> in the command with
          <span class="command"><strong>dnf</strong></span>):
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum install mysql-community-server</code></strong>
</pre><p>
          This installs the package for MySQL server
          (<code class="filename">mysql-community-server</code>) and also
          packages for the components required to run the server,
          including packages for the client
          (<code class="filename">mysql-community-client</code>), the common
          error messages and character sets for client and server
          (<code class="filename">mysql-community-common</code>), and the shared
          client libraries (<code class="filename">mysql-community-libs</code>).
</p></li><li class="listitem">
<h4><a name="yum-repo-starting-and-stopping-server"></a>Starting the MySQL Server</h4>
<p>
          Start the MySQL server with the following command:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo service mysqld start</code></strong>
Starting mysqld:[ OK ]
</pre><p>
          You can check the status of the MySQL server with the
          following command:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo service mysqld status</code></strong>
mysqld (pid 3066) is running.
</pre></li></ol>
</div>
<p>
      At the initial start up of the server, the following happens,
      given that the data directory of the server is empty:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The server is initialized.
        </p></li><li class="listitem"><p>
          SSL certificate and key files are generated in the data
          directory.
        </p></li><li class="listitem"><p>
          <a class="link" href="security.html#validate-password" title="6.5.3 The Password Validation Component"><code class="literal">validate_password</code></a>
          is installed and enabled.
        </p></li><li class="listitem"><p>
          A superuser account <code class="literal">'root'@'localhost</code> is
          created. A password for the superuser is set and stored in the
          error log file. To reveal it, use the following command:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo grep 'temporary password' /var/log/mysqld.log</code></strong>
</pre><p>
          Change the root password as soon as possible by logging in
          with the generated, temporary password and set a custom
          password for the superuser account:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -uroot -p </code></strong>
</pre><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            <a class="link" href="security.html#validate-password" title="6.5.3 The Password Validation Component"><code class="literal">validate_password</code></a>
            is installed by default. The default password policy
            implemented by <code class="literal">validate_password</code> requires
            that passwords contain at least one upper case letter, one
            lower case letter, one digit, and one special character, and
            that the total password length is at least 8 characters.
</p>
</div>
</li></ul>
</div>
<p>
      For more information on the postinstallation procedures, see
      <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p><a name="yum-install-compatibility-el7"></a>
        <span class="emphasis"><em>Compatibility Information for EL7-based
        platforms:</em></span> The following RPM packages from the native
        software repositories of the platforms are incompatible with the
        package from the MySQL Yum repository that installs the MySQL
        server. Once you have installed MySQL using the MySQL Yum
        repository, you will not be able to install these packages (and
        vice versa).
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            akonadi-mysql
</p></li></ul>
</div>

</div>
<h4><a name="yum-install-components"></a>Installing Additional MySQL Products and Components with Yum</h4>
<p>
      You can use Yum to install and manage individual components of
      MySQL. Some of these components are hosted in sub-repositories of
      the MySQL Yum repository: for example, the MySQL Connectors are to
      be found in the MySQL Connectors Community sub-repository, and the
      MySQL Workbench in MySQL Tools Community. You can use the
      following command to list the packages for all the MySQL
      components available for your platform from the MySQL Yum
      repository (for dnf-enabled systems, replace
      <span class="command"><strong>yum</strong></span> in the command with
      <span class="command"><strong>dnf</strong></span>):
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum --disablerepo=\* --enablerepo='mysql*-community*' list available</code></strong>
</pre><p>
      Install any packages of your choice with the following command,
      replacing <em class="replaceable"><code>package-name</code></em> with name of the
      package (for dnf-enabled systems, replace <span class="command"><strong>yum</strong></span>
      in the command with <span class="command"><strong>dnf</strong></span>):
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum install <em class="replaceable"><code>package-name</code></em></code></strong>
</pre><p>
      For example, to install MySQL Workbench on Fedora:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo dnf install mysql-workbench-community</code></strong>
</pre><p>
      To install the shared client libraries (for dnf-enabled systems,
      replace <span class="command"><strong>yum</strong></span> in the command with
      <span class="command"><strong>dnf</strong></span>):
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum install mysql-community-libs</code></strong>
</pre>
<h4><a name="idm139899657970816"></a>Updating MySQL with Yum</h4>
<p>
      Besides installation, you can also perform updates for MySQL
      products and components using the MySQL Yum repository. See
      <a class="xref" href="installing.html#updating-yum-repo" title="2.11.1.3 Upgrading MySQL with the MySQL Yum Repository">Section 2.11.1.3, “Upgrading MySQL with the MySQL Yum Repository”</a> for details.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-apt-repo"></a>2.5.2 Installing MySQL on Linux Using the MySQL APT Repository</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899657967552"></a><a class="indexterm" name="idm139899657966064"></a><p>
      The MySQL APT repository provides <code class="filename">deb</code>
      packages for installing and managing the MySQL server, client, and
      other components on the following Linux platforms:

</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Debian 9
          </p></li><li class="listitem"><p>
            Ubuntu 16.04, 17.10, and 18.04
</p></li></ul>
</div>
<p>
    </p><p>
      Instructions for using the MySQL APT Repository are available in
      <a class="ulink" href="http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/" target="_top">A Quick
      Guide to Using the MySQL APT Repository</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-sles-repo"></a>2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899657958672"></a><a class="indexterm" name="idm139899657957184"></a><p>
      The MySQL SLES repository provides RPM packages for installing and
      managing the MySQL server, client, and other components on SUSE
      Enterprise Linux Server.
    </p><p>
      Instructions for using the MySQL SLES repository are available in
      <a class="ulink" href="http://dev.mysql.com/doc/mysql-sles-repo-quick-guide/en/" target="_top">A
      Quick Guide to Using the MySQL SLES Repository</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The MySQL SLES repository is now in development release. We
        encourage you to try it and provide us with feedback. Please
        report any bugs or inconsistencies you observe to our
        <a class="ulink" href="http://bugs.mysql.com" target="_top">Bugs Database</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-rpm"></a>2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899657951232"></a><a class="indexterm" name="idm139899657950192"></a><a class="indexterm" name="idm139899657949120"></a><p>
      The recommended way to install MySQL on RPM-based Linux
      distributions is by using the RPM packages provided by Oracle.
      There are two sources for obtaining them, for the Community
      Edition of MySQL:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          From the MySQL software repositories:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              The MySQL Yum repository (see
              <a class="xref" href="installing.html#linux-installation-yum-repo" title="2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository">Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”</a> for
              details).
            </p></li><li class="listitem"><p>
              The MySQL SLES repository (see
              <a class="xref" href="installing.html#linux-installation-sles-repo" title="2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository">Section 2.5.3, “Installing MySQL on Linux Using the MySQL SLES Repository”</a> for
              details).
</p></li></ul>
</div>
</li><li class="listitem"><p>
          From the <a class="ulink" href="http://dev.mysql.com/downloads/mysql/" target="_top"> Download
          MySQL Community Server</a> page in the
          <a class="ulink" href="http://dev.mysql.com/" target="_top">MySQL Developer Zone</a>.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
        RPM distributions of MySQL are also provided by other vendors.
        Be aware that they may differ from those built by Oracle in
        features, capabilities, and conventions (including communication
        setup), and that the installation instructions in this manual do
        not necessarily apply to them. The vendor's instructions should
        be consulted instead.
</p>
</div>
<p>
      RPM packages for MySQL are listed in the following tables:
</p>
<div class="table">
<a name="idm139899657937136"></a><p class="title"><b>Table 2.8 RPM Packages for MySQL Community Edition</b></p>
<div class="table-contents">
<table frame="all"><col width="35%"><col width="25%"><thead><tr>
          <th scope="col">Package Name</th>
          <th scope="col">Summary</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">mysql-community-server</code></td>
          <td>Database server and related tools</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-client</code></td>
          <td>MySQL client applications and tools</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-common</code></td>
          <td>Common files for server and client libraries</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-server-minimal</code></td>
          <td>Minimal installation of the database server and related tools</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-devel </code></td>
          <td>Development header files and libraries for MySQL database client
            applications</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-libs </code></td>
          <td>Shared libraries for MySQL database client applications</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-libs-compat</code></td>
          <td>Shared compatibility libraries for previous MySQL installations</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-community-test </code></td>
          <td>Test suite for the MySQL server</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="idm139899657908272"></a><p class="title"><b>Table 2.9 RPM Packages for the MySQL Enterprise Edition</b></p>
<div class="table-contents">
<table frame="all"><col width="35%"><col width="25%"><thead><tr>
          <th scope="col">Package Name</th>
          <th scope="col">Summary</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">mysql-commercial-server</code></td>
          <td>Database server and related tools</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-client</code></td>
          <td>MySQL client applications and tools</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-common</code></td>
          <td>Common files for server and client libraries</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-server-minimal</code></td>
          <td>Minimal installation of the database server and related tools</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-devel </code></td>
          <td>Development header files and libraries for MySQL database client
            applications</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-libs </code></td>
          <td>Shared libraries for MySQL database client applications</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-libs-compat</code></td>
          <td>Shared compatibility libraries for previous MySQL installations</td>
        </tr><tr>
          <td scope="row"><code class="literal">mysql-commercial-test </code></td>
          <td>Test suite for the MySQL server</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      The full names for the RPMs have the following syntax:
    </p><pre data-lang="terminal" class="programlisting">
<em class="replaceable"><code>packagename</code></em>-<em class="replaceable"><code>version</code></em>-<em class="replaceable"><code>distribution</code></em>-<em class="replaceable"><code>arch</code></em>.rpm
</pre><p>
      The <em class="replaceable"><code>distribution</code></em> and
      <em class="replaceable"><code>arch</code></em> values indicate the Linux
      distribution and the processor type for which the package was
      built. See the table below for lists of the distribution
      identifiers:
</p>
<div class="table">
<a name="idm139899657874896"></a><p class="title"><b>Table 2.10 MySQL Linux RPM Package Distribution Identifiers</b></p>
<div class="table-contents">
<table><col width="25%"><col width="75%"><thead><tr>
          <th scope="col">distribution Value</th>
          <th scope="col">Intended Use</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">el6</code>, <code class="literal">el7</code></td>
          <td>Red Hat Enterprise Linux/Oracle Linux/CentOS 6 or 7</td>
        </tr><tr>
          <td scope="row"><code class="literal">fc26</code>, <code class="literal">fc27</code></td>
          <td>Fedora 26 and 27</td>
        </tr><tr>
          <td scope="row"><code class="literal">sles12</code></td>
          <td>SUSE Linux Enterprise Server 12</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      To see all files in an RPM package (for example,
      <code class="literal">mysql-community-server</code>), use the following
      command:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpm -qpl mysql-community-server-<em class="replaceable"><code>version</code></em>-<em class="replaceable"><code>distribution</code></em>-<em class="replaceable"><code>arch</code></em>.rpm</code></strong>
</pre><p>
      <span class="emphasis"><em>The discussion in the rest of this section applies only
      to an installation process using the RPM packages directly
      downloaded from Oracle, instead of through a MySQL
      repository.</em></span>
    </p><p>
      Dependency relationships exist among some of the packages. If you
      plan to install many of the packages, you may wish to download the
      RPM bundle <span class="command"><strong>tar</strong></span> file instead, which contains all
      the RPM packages listed above, so that you need not download them
      separately.
    </p><p>
      In most cases, you need to install the
      <code class="literal">mysql-community-server</code>,
      <code class="literal">mysql-community-client</code>,
      <code class="literal">mysql-community-libs</code>,
      <code class="literal">mysql-community-common</code>, and
      <code class="literal">mysql-community-libs-compat</code> packages to get a
      functional, standard MySQL installation. To perform such a
      standard, basic installation, go to the folder that contains all
      those packages (and, preferably, no other RPM packages with
      similar names), and issue the following command:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum install mysql-community-{server,client,common,libs}-* </code></strong>
</pre><p>
      Replace <span class="command"><strong>yum</strong></span> with <span class="command"><strong>zypper</strong></span> for
      SLES, and with <span class="command"><strong>dnf</strong></span> for Fedora.
    </p><p>
      While it is much preferable to use a high-level package management
      tool like <span class="command"><strong>yum</strong></span> to install the packages, users
      who prefer direct <span class="command"><strong>rpm</strong></span> commands can replace the
      <span class="command"><strong>yum install</strong></span> command with the <span class="command"><strong>rpm
      -Uvh</strong></span> command; however, using <span class="command"><strong>rpm -Uvh</strong></span>
      instead makes the installation process more prone to failure, due
      to potential dependency issues the installation process might run
      into.
    </p><p>
      To install only the client programs, you can skip
      <code class="literal">mysql-community-server</code> in your list of packages
      to install; issue the following command:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo yum install mysql-community-{client,common,libs}-* </code></strong>
</pre><p>
      Replace <span class="command"><strong>yum</strong></span> with <span class="command"><strong>zypper</strong></span> for
      SLES, and with <span class="command"><strong>dnf</strong></span> for Fedora.
    </p><p>
      A standard installation of MySQL using the RPM packages result in
      files and resources created under the system directories, shown in
      the following table.
</p>
<div class="table">
<a name="mysql-installation-layout-linuxrpm"></a><p class="title"><b>Table 2.11 MySQL Installation Layout for Linux RPM Packages from the MySQL
Developer Zone</b></p>
<div class="table-contents">
<table><col width="55%"><col width="45%"><thead><tr>
          <th scope="col">Files or Resources</th>
          <th scope="col">Location</th>
        </tr></thead><tbody><tr>
          <td scope="row">Client programs and scripts</td>
          <td><code class="filename">/usr/bin</code></td>
        </tr><tr>
          <td scope="row"><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server</td>
          <td><code class="filename">/usr/sbin</code></td>
        </tr><tr>
          <td scope="row">Configuration file</td>
          <td><code class="filename">/etc/my.cnf</code></td>
        </tr><tr>
          <td scope="row">Data directory</td>
          <td><code class="filename">/var/lib/mysql</code></td>
        </tr><tr>
          <td scope="row">Error log file</td>
          <td><p>
              For RHEL, Oracle Linux, CentOS or Fedora platforms:
              <code class="filename">/var/log/mysqld.log</code>
            </p><p>
              For SLES: <code class="filename">/var/log/mysql/mysqld.log</code>
            </p></td>
        </tr><tr>
          <td scope="row">Value of <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a></td>
          <td><code class="filename">/var/lib/mysql-files</code></td>
        </tr><tr>
          <td scope="row">System V init script</td>
          <td><p>
              For RHEL, Oracle Linux, CentOS or Fedora platforms:
              <code class="filename">/etc/init.d/mysqld</code>
            </p><p>
              For SLES: <code class="filename">/etc/init.d/mysql</code>
            </p></td>
        </tr><tr>
          <td scope="row">Systemd service</td>
          <td><p>
              For RHEL, Oracle Linux, CentOS or Fedora platforms:
              <code class="filename">mysqld</code>
            </p><p>
              For SLES: <code class="filename">mysql</code>
            </p></td>
        </tr><tr>
          <td scope="row">Pid file</td>
          <td><code class="filename"> /var/run/mysql/mysqld.pid</code></td>
        </tr><tr>
          <td scope="row">Socket</td>
          <td><code class="filename">/var/lib/mysql/mysql.sock</code></td>
        </tr><tr>
          <td scope="row">Keyring directory</td>
          <td><code class="filename">/var/lib/mysql-keyring</code></td>
        </tr><tr>
          <td scope="row">Unix manual pages</td>
          <td><code class="filename">/usr/share/man</code></td>
        </tr><tr>
          <td scope="row">Include (header) files</td>
          <td><code class="filename">/usr/include/mysql</code></td>
        </tr><tr>
          <td scope="row">Libraries</td>
          <td><code class="filename">/usr/lib/mysql</code></td>
        </tr><tr>
          <td scope="row">Miscellaneous support files (for example, error messages, and character
            set files)</td>
          <td><code class="filename">/usr/share/mysql</code></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      The installation also creates a user named
      <code class="literal">mysql</code> and a group named
      <code class="literal">mysql</code> on the system.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        Installation of previous versions of MySQL using older packages
        might have created a configuration file named
        <code class="filename">/usr/my.cnf</code>. It is highly recommended that
        you examine the contents of the file and migrate the desired
        settings inside to the file <code class="filename">/etc/my.cnf</code>
        file, then remove <code class="filename">/usr/my.cnf</code>.
</p>
</div>
<p>
      MySQL is NOT automatically started at the end of the installation
      process. For Red Hat Enterprise Linux, Oracle Linux, CentOS, and
      Fedora systems, use the following command to start MySQL:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo service mysqld start</code></strong>
</pre><p>
      For SLES systems, the command is the same, but the service name is
      different:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo service mysql start</code></strong>
</pre><p>
      If the operating system is systemd enabled, standard
      <span class="command"><strong>service</strong></span> commands such as
      <span class="command"><strong>stop</strong></span>, <span class="command"><strong>start</strong></span>,
      <span class="command"><strong>status</strong></span> and <a class="link" href="sql-syntax.html#restart" title="13.7.7.8 RESTART Syntax"><span class="command"><strong>restart</strong></span></a> should be
      used to manage the MySQL server service. The
      <code class="literal">mysqld</code> service is enabled by default, and it
      starts at system reboot. Notice that certain things might work
      differently on systemd platforms: for example, changing the
      location of the data directory might cause issues. See
      <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a> for additional information.
    </p><p>
      During an upgrade installation using RPM packages, if the MySQL
      server is running when the upgrade occurs then the MySQL server is
      stopped, the upgrade occurs, and the MySQL server is restarted.
      One exception: if the edition also changes during an upgrade (such
      as community to commercial, or vice-versa), then MySQL server is
      not restarted.
    </p><p>
      At the initial start up of the server, the following happens,
      given that the data directory of the server is empty:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The server is initialized.
        </p></li><li class="listitem"><p>
          An SSL certificate and key files are generated in the data
          directory.
        </p></li><li class="listitem"><p>
          <a class="link" href="security.html#validate-password" title="6.5.3 The Password Validation Component"><code class="literal">validate_password</code></a>
          is installed and enabled.
        </p></li><li class="listitem"><p>
          A superuser account <code class="literal">'root'@'localhost'</code> is
          created. A password for the superuser is set and stored in the
          error log file. To reveal it, use the following command for
          RHEL, Oracle Linux, CentOS, and Fedora systems:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo grep 'temporary password' /var/log/mysqld.log</code></strong>
</pre><p>
          Use the following command for SLES systems:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo grep 'temporary password' /var/log/mysql/mysqld.log</code></strong>
</pre><p>
          The next step is to log in with the generated, temporary
          password and set a custom password for the superuser account:
</p></li></ul>
</div>
<pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -uroot -p </code></strong>
</pre><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        <a class="link" href="security.html#validate-password" title="6.5.3 The Password Validation Component"><code class="literal">validate_password</code></a>
        is installed by default. The default password policy implemented
        by <code class="literal">validate_password</code> requires that passwords
        contain at least one upper case letter, one lower case letter,
        one digit, and one special character, and that the total
        password length is at least 8 characters.
</p>
</div>
<p>
      If something goes wrong during installation, you might find debug
      information in the error log file
      <code class="filename">/var/log/mysqld.log</code>.
    </p><p>
      For some Linux distributions, it might be necessary to increase
      the limit on number of file descriptors available to
      <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. See
      <a class="xref" href="error-handling.html#not-enough-file-handles" title="B.5.2.17 File Not Found and Similar Errors">Section B.5.2.17, “File Not Found and Similar Errors”</a>
    </p><p><b>Installing Client Libraries from Multiple MySQL Versions. </b>
        It is possible to install multiple client library versions, such
        as for the case that you want to maintain compatibility with
        older applications linked against previous libraries. To install
        an older client library, use the <code class="option">--oldpackage</code>
        option with <span class="command"><strong>rpm</strong></span>. For example, to install
        <code class="literal">mysql-community-libs-5.5</code> on an EL6 system
        that has <code class="literal">libmysqlclient.21</code> from MySQL 8.0,
        use a command like this:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpm --oldpackage -ivh mysql-community-libs-5.5.50-2.el6.x86_64.rpm</code></strong>
</pre><p><b>Debug Package. </b>
        A special variant of MySQL Server compiled with the
        <a class="link" href="extending-mysql.html#dbug-package" title="28.5.3 The DBUG Package">debug package</a> has been
        included in the server RPM packages. It performs debugging and
        memory allocation checks and produces a trace file when the
        server is running. To use that debug version, start MySQL with
        <code class="filename">/usr/sbin/mysqld-debug</code>, instead of starting
        it as a service or with <code class="filename">/usr/sbin/mysqld</code>.
        See <a class="xref" href="extending-mysql.html#dbug-package" title="28.5.3 The DBUG Package">Section 28.5.3, “The DBUG Package”</a> for the debug options you can
        use.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The default plugin directory for debug builds changed from
        <code class="filename">/usr/lib64/mysql/plugin</code> to
        <code class="filename">/usr/lib64/mysql/plugin/debug</code> in 8.0.4.
        Previously, manually changing <code class="option">plugin_dir</code> was
        required.
</p>
</div>
<p><b>Rebuilding RPMs from source SRPMs. </b>
        Source code SRPM packages for MySQL are available for download.
        They can be used as-is to rebuild the MySQL RPMs with the
        standard <span class="command"><strong>rpmbuild</strong></span> tool chain.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-debian"></a>2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle</h3>

</div>

</div>

</div>
<p>
      Oracle provides Debian packages for installing MySQL on Debian or
      Debian-like Linux systems. The packages are available through two
      different channels:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <a class="ulink" href="http://dev.mysql.com/downloads/repo/apt/" target="_top">MySQL APT
          Repository</a>. This is the preferred method for
          installing MySQL on Debian-like systems, as it provides a
          simple and convenient way to install and update MySQL
          products. For details, see
          <a class="xref" href="installing.html#linux-installation-apt-repo" title="2.5.2 Installing MySQL on Linux Using the MySQL APT Repository">Section 2.5.2, “Installing MySQL on Linux Using the MySQL APT Repository”</a>.
        </p></li><li class="listitem"><p>
          The <a class="ulink" href="http://dev.mysql.com/downloads/" target="_top">MySQL Developer Zone's
          Download Area</a>. For details, see
          <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>. The following are some
          information on the Debian packages available there and the
          instructions for installing them:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              Various Debian packages are provided in the MySQL
              Developer Zone for installing different components of
              MySQL on different Debian or Ubuntu platforms (currently,
              Debian 9, and Ubuntu 16, 17, and 18 are supported). The
              preferred method is to use the tarball bundle, which
              contains the packages needed for a basic setup of MySQL.
              The tarball bundles have names in the format of
              <code class="filename">mysql-server_<em class="replaceable"><code>MVER</code></em>-<em class="replaceable"><code>DVER</code></em>_<em class="replaceable"><code>CPU</code></em>.deb-bundle.tar</code>.
              <em class="replaceable"><code>MVER</code></em> is the MySQL version and
              <em class="replaceable"><code>DVER</code></em> is the Linux distribution
              version. The <em class="replaceable"><code>CPU</code></em> value
              indicates the processor type or family for which the
              package is built, as shown in the following table:
</p>
<div class="table">
<a name="idm139899657713056"></a><p class="title"><b>Table 2.12 MySQL Debian and Ubuntu Installation Packages CPU Identifiers</b></p>
<div class="table-contents">
<table><col width="25%"><col width="75%"><thead><tr>
                  <th scope="col"><em class="replaceable"><code>CPU</code></em> Value</th>
                  <th scope="col">Intended Processor Type or Family</th>
                </tr></thead><tbody><tr>
                  <td scope="row"><code class="literal">i386</code></td>
                  <td>Pentium processor or better, 32 bit</td>
                </tr><tr>
                  <td scope="row"><code class="literal">amd64</code></td>
                  <td>64-bit x86 processor</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"></li><li class="listitem"><p>
              After downloading the tarball, unpack it with the
              following command:
            </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>tar -xvf mysql-server_<em class="replaceable"><code>MVER</code></em>-<em class="replaceable"><code>DVER</code></em>_<em class="replaceable"><code>CPU</code></em>.deb-bundle.tar</code></strong>
</pre></li><li class="listitem"><p>
              <a class="indexterm" name="idm139899657696960"></a>

              You may need to install the <code class="literal">libaio</code>
              library if it is not already present on your system:
            </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo apt-get install libaio1</code></strong>
</pre></li><li class="listitem"><p>
              Preconfigure the MySQL server package with the following
              command:
            </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo dpkg-preconfigure mysql-community-server_*.deb</code></strong>
</pre><p>
              You will be asked to provide a password for the root user
              for your MySQL installation. You might also be asked other
              questions regarding the installation.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p><a name="linux-installing-debian-password"></a>
                Make sure you remember the root password you set. Users
                who want to set a password later can leave the
                <span class="guilabel">password</span> field blank in the
                dialogue box and just press <span class="guibutton">OK</span>;
                in that case, root access to the server is authenticated
                using the
                <a class="link" href="security.html#socket-pluggable-authentication" title="6.5.1.9 Socket Peer-Credential Pluggable Authentication">MySQL
                Socket Peer-Credential Authentication Plugin</a> for
                connections using a Unix socket file. You can set the
                root password later using
                <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a>.
</p>
</div>
</li><li class="listitem"><p>
              For a basic installation of the MySQL server, install the
              database common files package, the client package, the
              client metapackage, the server package, and the server
              metapackage (in that order); you can do that with a single
              command:
            </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>sudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb</code></strong>
</pre><p>
              There are also packages with
              <code class="literal">server-core</code> and
              <code class="literal">client-core</code> in the package names. These
              contain binaries only and are installed automatically by
              the standard packages. Installing them by themselves will
              not result in a functioning MySQL setup.
            </p><p>
              If you are being warned of unmet dependencies by
              <span class="command"><strong>dpkg</strong></span>, you can fix them using
              <span class="command"><strong>apt-get</strong></span>:
            </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>sudo apt-get -f install</code></strong></pre><p>
              Here are where the files are installed on the system:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; "><li class="listitem"><p>
                  All configuration files (like
                  <code class="filename">my.cnf</code>) are under
                  <code class="filename">/etc/mysql</code>
                </p></li><li class="listitem"><p>
                  All binaries, libraries, headers, etc., are under
                  <code class="filename">/usr/bin</code> and
                  <code class="filename">/usr/sbin</code>
                </p></li><li class="listitem"><p>
                  The data directory is under
                  <code class="filename">/var/lib/mysql</code>
</p></li></ul>
</div>
</li></ul>
</div>
</li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
        Debian distributions of MySQL are also provided by other
        vendors. Be aware that they may differ from those built by
        Oracle in features, capabilities, and conventions (including
        communication setup), and that the instructions in this manual
        do not necessarily apply to installing them. The vendor's
        instructions should be consulted instead.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-docker"></a>2.5.6 Deploying MySQL on Linux with Docker</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#docker-mysql-getting-started">2.5.6.1 Basic Steps for MySQL Server Deployment with Docker</a></span></dt><dt><span class="section"><a href="installing.html#docker-mysql-more-topics">2.5.6.2 More Topics on Deploying MySQL Server with Docker</a></span></dt></dl>
</div>
<p>
      The Docker deployment framework supports easy installation and
      configuration of MySQL Server. This section explains how to use a
      MySQL Server Docker image.
    </p><p>
      You need to have Docker installed on your system before you can
      use a MySQL Server Docker image. See
      <a class="ulink" href="https://docs.docker.com/engine/installation/" target="_top">Install
      Docker</a> for instructions.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
        You need to either run <code class="literal">docker</code> commands with
        <code class="literal">sudo</code>, or create a <code class="literal">docker</code>
        usergroup, and then add to it any users who want to run
        <code class="literal">docker</code> commands. See details
        <a class="ulink" href="https://docs.docker.com/engine/installation/linux/linux-postinstall/" target="_top">here</a>.
        Because Docker containers are always run with root privileges,
        you should understand the
        <a class="ulink" href="https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface" target="_top">Docker
        daemon attack surface</a> and properly mitigate the related
        risks.
</p>
</div>
<p>
      The instructions for using the MySQL Docker container are divided
      into two sections.

      
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="docker-mysql-getting-started"></a>2.5.6.1 Basic Steps for MySQL Server Deployment with Docker</h4>

</div>

</div>

</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#docker-download-image" title="Downloading a MySQL Server Docker Image">Downloading a MySQL Server Docker Image</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-starting-mysql-server" title="Starting a MySQL Server Instance">Starting a MySQL Server Instance</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-connecting-within-container" title="Connecting to MySQL Server from within the Container">Connecting to MySQL Server from within the Container</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-shell-access" title="Container Shell Access">Container Shell Access</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-stopping-deleting" title="Stopping and Deleting a MySQL Container">Stopping and Deleting a MySQL Container</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-more-topics" title="More Topics on Deploying MySQL Server with Docker">More Topics on Deploying MySQL Server with Docker</a></p></li></ul>
</div>
<h5><a name="docker-download-image"></a>Downloading a MySQL Server Docker Image</h5>
<p>
        Downloading the server image in a separate step is not strictly
        necessary; however, performing this step before you create your
        Docker container ensures your local image is up to date. To
        download the MySQL Community Server image, run this command:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker pull mysql/mysql-server:<em class="replaceable"><code>tag</code></em></code></strong></pre><p>
        The <em class="replaceable"><code>tag</code></em> is the label for the image
        version you want to pull (for example, <code class="literal">5.5</code>,
        <code class="literal">5.6</code>, <code class="literal">5.7</code>,
        <code class="literal">8.0</code>, or <code class="literal">latest</code>). If
        <strong class="userinput"><code>:<em class="replaceable"><code>tag</code></em></code></strong> is
        omitted, the <code class="literal">latest</code> label is used, and the
        image for the latest GA version of MySQL Community Server is
        downloaded. Refer to the list of tags for available versions on
        the
        <a class="ulink" href="https://hub.docker.com/r/mysql/mysql-server/tags/" target="_top">mysql/mysql-server
        page in the Docker Hub</a>.
      </p><p>
        You can list downloaded Docker images with this command:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>docker images</code></strong>
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
mysql/mysql-server   latest              3157d7f55f8d        4 weeks ago         241MB
</pre>
<h5><a name="docker-starting-mysql-server"></a>Starting a MySQL Server Instance</h5>
<p>
        Start a new Docker container for the MySQL Server with this
        command:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker run --name=mysql1 -d mysql/mysql-server:<em class="replaceable"><code>tag</code></em></code></strong> </pre><p>
        The <code class="option">--name</code> option, for supplying a custom name
        for your server container (<code class="literal">mysql1</code> in the
        example), is optional; if no container name is supplied, a
        random one is generated. If the Docker image of the specified
        name and tag has not been downloaded by an earlier
        <span class="command"><strong>docker pull</strong></span> or <span class="command"><strong>docker run</strong></span>
        command, the image is now downloaded. After download completes,
        initialization for the container begins, and the container
        appears in the list of running containers when you run the
        <span class="command"><strong>docker ps</strong></span> command; for example:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>docker ps</code></strong>
CONTAINER ID   IMAGE                COMMAND                  CREATED             STATUS                              PORTS                NAMES
a24888f0d6f4   mysql/mysql-server   "/entrypoint.sh my..."   14 seconds ago      Up 13 seconds (health: starting)    3306/tcp, 33060/tcp  mysql1 
</pre><p>
        The container initialization might take some time. When the
        server is ready for use, the <code class="literal">STATUS</code> of the
        container in the output of the <span class="command"><strong>docker ps</strong></span>
        command changes from <code class="literal">(health: starting)</code> to
        <code class="literal">(healthy)</code>.
      </p><p>
        The <code class="option">-d</code> option used in the <span class="command"><strong>docker
        run</strong></span> command above makes the container run in the
        background. Use this command to monitor the output from the
        container:

</p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker logs mysql1</code></strong></pre><p>
      </p><p>
        Once initialization is finished, the command's output is going
        to contain the random password generated for the root user;
        check the password with, for example, this command:

</p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>docker logs mysql1 2&gt;&amp;1 | grep GENERATED</code></strong>
GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&amp;EShOs</pre><p>
</p>
<h5><a name="docker-connecting-within-container"></a>Connecting to MySQL Server from within the Container</h5>
<p>
        Once the server is ready, you can run the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client within the MySQL Server
        container you just started, and connect it to the MySQL Server.
        Use the <span class="command"><strong>docker exec -it</strong></span> command to start a
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client inside the Docker container you
        have started, like the following:

</p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker exec -it mysql1 mysql -uroot -p</code></strong></pre><p>

        When asked, enter the generated root password (see the last step
        in <a class="xref" href="installing.html#docker-starting-mysql-server" title="Starting a MySQL Server Instance">Starting a MySQL Server Instance</a> above on how
        to find the password). Because the
        <a class="link" href="installing.html#docker_var_mysql_onetime_password"><code class="option">MYSQL_ONETIME_PASSWORD</code></a>
        option is true by default, after you have connected a
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client to the server, you must reset
        the server root password by issuing this statement:

</p><pre data-lang="terminal" class="programlisting">mysql&gt; <strong class="userinput"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY '<em class="replaceable"><code>newpassword</code></em>';</code></strong></pre><p>

        Substitute <em class="replaceable"><code>newpassword</code></em> with the
        password of your choice. Once the password is reset, the server
        is ready for use.
</p>
<h5><a name="docker-shell-access"></a>Container Shell Access</h5>
<p>
        To have shell access to your MySQL Server container, use the
        <span class="command"><strong>docker exec -it</strong></span> command to start a bash shell
        inside the container:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>docker exec -it mysql1 bash</code></strong> 
bash-4.2#</pre><p>
        You can then run Linux commands inside the container. For
        example, to view contents in the server's data directory inside
        the container, use this command:
      </p><pre data-lang="terminal" class="programlisting">bash-4.2# <strong class="userinput"><code>ls /var/lib/mysql</code></strong>
auto.cnf    ca.pem	     client-key.pem  ib_logfile0  ibdata1  mysql       mysql.sock.lock	   private_key.pem  server-cert.pem  sys
ca-key.pem  client-cert.pem  ib_buffer_pool  ib_logfile1  ibtmp1   mysql.sock  performance_schema  public_key.pem   server-key.pem
</pre>
<h5><a name="docker-stopping-deleting"></a>Stopping and Deleting a MySQL Container</h5>
<p>
        To stop the MySQL Server container we have created, use this
        command:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker stop mysql1</code></strong></pre><p>
        <span class="command"><strong>docker stop</strong></span> sends a SIGTERM signal to the
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> process, so that the server is shut
        down gracefully.
      </p><p>
        Also notice that when the main process of a container
        (<a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> in the case of a MySQL Server
        container) is stopped, the Docker container stops automatically.
      </p><p>
        To start the MySQL Server container again:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker start mysql1</code></strong></pre><p>
        To stop and start again the MySQL Server container with a single
        command:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker restart mysql1</code></strong></pre><p>
        To delete the MySQL container, stop it first, and then use the
        <span class="command"><strong>docker rm</strong></span> command:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker stop mysql1</code></strong></pre><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker rm mysql1</code></strong> </pre><p>
        If you want the
        <a class="link" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Docker
        volume for the server's data directory</a> to be deleted at
        the same time, add the <code class="literal">-v</code> option to the
        <span class="command"><strong>docker rm</strong></span> command.
</p>
<h5><a name="docker-more-topics"></a>More Topics on Deploying MySQL Server with Docker</h5>
<p>
        For more topics on deploying MySQL Server with Docker like
        server configuration, persisting data and configuration, server
        error log, and container environment variables, see
        <a class="xref" href="installing.html#docker-mysql-more-topics" title="2.5.6.2 More Topics on Deploying MySQL Server with Docker">Section 2.5.6.2, “More Topics on Deploying MySQL Server with Docker”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="docker-mysql-more-topics"></a>2.5.6.2 More Topics on Deploying MySQL Server with Docker</h4>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#docker-optimized-installation" title="The Optimized MySQL Installation for Docker">The Optimized MySQL Installation for Docker</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-configuring-server" title="Configuring the MySQL Server">Configuring the MySQL Server</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-additional-init" title="Running Additional Initialization Scripts">Running Additional Initialization Scripts</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-app-in-another-container" title="Connect to MySQL from an Application in Another Docker Container">Connect to MySQL from an Application in Another Docker Container</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-server-error-log" title="Server Error Log">Server Error Log</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#docker-environment-variables" title="Docker Environment Variables">Docker Environment Variables</a></p></li></ul>
</div>
<h5><a name="docker-optimized-installation"></a>The Optimized MySQL Installation for Docker</h5>
<p>
        Docker images for MySQL are optimized for code size, which means
        they only include crucial components that are expected to be
        relevant for the majority of users who run MySQL instances in
        Docker containers. A MySQL Docker installation is different from
        a common, non-Docker installation in the following aspects:

</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Included binaries are limited to:

</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    /usr/bin/my_print_defaults
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysql
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysql_config
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysql_install_db
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysql_tzinfo_to_sql
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysql_upgrade
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysqladmin
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysqlcheck
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysqldump
                  </p></li><li class="listitem"><p>
                    /usr/bin/mysqlpump
                  </p></li><li class="listitem"><p>
                    /usr/sbin/mysqld
</p></li></ul>
</div>
<p>
            </p></li><li class="listitem"><p>
              All binaries are stripped; they contain no debug
              information.
</p></li></ul>
</div>
<p>
</p>
<h5><a name="docker-configuring-server"></a>Configuring the MySQL Server</h5>
<p>
        When you start the MySQL Docker container, you can pass
        configuration options to the server through the <span class="command"><strong>docker
        run</strong></span> command; for example, for the MySQL Server:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker run --name mysql1 -d mysql/mysql-server --character-set-server=utf8mb4 --collation-server=utf8mb4_col</code></strong></pre><p>
        The command starts your MySQL Server with
        <code class="literal">utf8mb4</code> as the default character set and
        <code class="literal">utf8mb4_col</code> as the default collation for your
        databases.
      </p><p>
        Another way to configure the MySQL Server is to prepare a
        configuration file and mount it at the location of the server
        configuration file inside the container. See
        <a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a> for
        details.
</p>
<h5><a name="docker-persisting-data-configuration"></a>Persisting Data and Configuration Changes</h5>
<p>
        Docker containers are in principle ephemeral, and any data or
        configuration are expected to be lost if the container is
        deleted or corrupted (see discussions
        <a class="ulink" href="https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/" target="_top">here</a>).
        <a class="ulink" href="https://docs.docker.com/engine/admin/volumes/volumes/" target="_top">Docker
        volumes</a>, however, provides a mechanism to persist data
        created inside a Docker container. At its initialization, the
        MySQL Server container creates a Docker volume for the server
        data directory. The JSON output for running the <span class="command"><strong>docker
        inspect</strong></span> command on the container has a
        <code class="literal">Mount</code> key, whose value provides information
        on the data directory volume:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>docker inspect mysql1</code></strong> 
...
 "Mounts": [
            {
                "Type": "volume",
                "Name": "4f2d463cfc4bdd4baebcb098c97d7da3337195ed2c6572bc0b89f7e845d27652",
                "Source": "/var/lib/docker/volumes/4f2d463cfc4bdd4baebcb098c97d7da3337195ed2c6572bc0b89f7e845d27652/_data",
                "Destination": "/var/lib/mysql",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
...
</pre><p>
        The output shows that the source folder<code class="filename">
        /var/lib/docker/volumes/4f2d463cfc4bdd4baebcb098c97d7da3337195ed2c6572bc0b89f7e845d27652/_data</code>,
        in which data is persisted on the host, has been mounted at
        <code class="filename">/var/lib/mysql</code>, the server data directory
        inside the container.
      </p><p>
        Another way to preserve data is to
        <a class="ulink" href="https://docs.docker.com/engine/reference/commandline/service_create/#add-bind-mounts-or-volumes" target="_top">bind-mount</a>
        a host directory using the <code class="option">--mount</code> option when
        creating the container. The same technique can be used to
        persist the configuration of the server. The following command
        creates a MySQL Server container and bind-mounts both the data
        directory and the server configuration file:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker run --name=mysql1 \
--mount type=bind,src=<em class="replaceable"><code>/path-on-host-machine/my.cnf</code></em>,dst=/etc/my.cnf \
--mount type=bind,src=<em class="replaceable"><code>/path-on-host-machine/datadir</code></em>,dst=/var/lib/mysql \
-d mysql/mysql-server:<em class="replaceable"><code>tag</code></em> </code></strong></pre><p>
        The command mounts
        <code class="filename"><em class="replaceable"><code>path-on-host-machine/my.cnf</code></em></code>
        at <code class="filename"><code class="filename">/etc/my.cnf</code></code> (the
        server configuration file inside the container), and
        <code class="filename"><em class="replaceable"><code>path-on-host-machine/datadir</code></em></code>
        at <code class="filename"><code class="filename">/var/lib/mysql</code></code> (the
        data directory inside the container). The following conditions
        must be met for the bind-mounting to work:

</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              The configuration file
              <code class="filename"><em class="replaceable"><code>path-on-host-machine/my.cnf</code></em></code>
              must already exist, and it must contain the specification
              for starting the server using the user
              <code class="literal">mysql</code>:
            </p><pre data-lang="ini" class="programlisting">[mysqld]
user=mysql</pre><p>
              You can also include other server configuration options in
              the file.
            </p></li><li class="listitem"><p>
              The data directory
              <code class="filename"><em class="replaceable"><code>path-on-host-machine/datadir</code></em></code>
              must already exist. For server initialization to happen,
              the directory must be empty. You can also mount a
              directory prepopulated with data and start the server with
              it; however, you must make sure you start the Docker
              container with the same configuration as the server that
              created the data, and any host files or directories
              required are mounted when starting the container.
</p></li></ul>
</div>
<p>
</p>
<h5><a name="docker-additional-init"></a>Running Additional Initialization Scripts</h5>
<p>
        If there are any <code class="filename">.sh</code> or
        <code class="filename">.sql</code> scripts you want to run on the
        database immediately after it has been created, you can put them
        into a host directory and then mount the directory at
        <code class="filename">/docker-entrypoint-initdb.d/</code> inside the
        container. For example, for a MySQL Server container:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker run --name=mysql1 \
--mount type=bind,src=<em class="replaceable"><code>/path-on-host-machine/scripts/</code></em>,dst=/docker-entrypoint-initdb.d/ \
-d mysql/mysql-server:<em class="replaceable"><code>tag</code></em></code></strong></pre>
<h5><a name="docker-app-in-another-container"></a>Connect to MySQL from an Application in Another Docker Container</h5>
<p>
        By setting up a Docker network, you can allow multiple Docker
        containers to communicate with each other, so that a client
        application in another Docker container can access the MySQL
        Server in the server container. First, create a Docker network:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker network create <em class="replaceable"><code>my-custom-net</code></em></code></strong></pre><p>
        Then, when you are creating and starting the server and the
        client containers, use the <code class="option">--network</code> option to
        put them on network you created. For example:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker run --name=mysql1 --network=<em class="replaceable"><code>my-custom-net</code></em> -d mysql/mysql-server</code></strong></pre><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker run --name=myapp1 --network=<em class="replaceable"><code>my-custom-net</code></em> -d myapp</code></strong></pre><p>
        The <code class="literal">myapp1</code> container can then connect to the
        <code class="literal">mysql1</code> container with the
        <code class="literal">mysql1</code> hostname and vice versa, as Docker
        automatically sets up a DNS for the given container names. In
        the following example, we run the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong><code class="literal">mysq</code>l</strong></span></a> client from inside
        the <code class="literal">myapp1</code> container to connect to host
        <code class="literal">mysql1</code> in its own container:
      </p><pre data-lang="terminal" class="programlisting"><strong class="userinput"><code>docker exec -it myapp1 mysql --host=mysql1 --user=myuser --password</code></strong></pre><p>
        For other networking techniques for containers, see the
        <a class="ulink" href="https://docs.docker.com/engine/userguide/networking/" target="_top">Docker
        container networking</a> section in the Docker
        Documentation.
</p>
<h5><a name="docker-server-error-log"></a>Server Error Log</h5>
<p>
        When the MySQL Server is first started with your server
        container, a <a class="link" href="server-administration.html#error-log" title="5.4.2 The Error Log">server error log</a>
        is NOT generated if either of the following conditions is true:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            A server configuration file from the host has been mounted,
            but the file does not contain the system variable
            <a class="link" href="server-administration.html#sysvar_log_error"><code class="literal">log_error</code></a> (see
            <a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a> on
            bind-mounting a server configuration file).
          </p></li><li class="listitem"><p>
            A server configuration file from the host has not been
            mounted, but the Docker environment variable
            <a class="link" href="installing.html#docker_var_mysql-log-console"><code class="option">MYSQL_LOG_CONSOLE</code></a>
            is <code class="literal">true</code> (which is the variable's default
            state for MySQL 8.0 server containers). The MySQL Server's
            error log is then redirected to <code class="literal">stderr</code>,
            so that the error log goes into the Docker container's log
            and is viewable using the <span class="command"><strong>docker logs
            <em class="replaceable"><code>mysqld-container</code></em></strong></span>
            command.
</p></li></ul>
</div>
<p>
        To make MySQL Server generate an error log when either of the
        two conditions is true, use the
        <a class="link" href="server-administration.html#option_mysqld_log-error"><code class="option">--log-error</code></a> option to
        <a class="link" href="installing.html#docker-configuring-server" title="Configuring the MySQL Server">configure the
        server</a> to generate the error log at a specific location
        inside the container. To persist the error log, mount a host
        file at the location of the error log inside the container as
        explained in
        <a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a>. However,
        you must make sure your MySQL Server inside its container has
        write access to the mounted host file.
</p>
<h5><a name="docker-environment-variables"></a>Docker Environment Variables</h5>
<p>
        When you create a MySQL Server container, you can configure the
        MySQL instance by using the <code class="option">--env</code> option
        (<code class="option">-e</code> in short) and specifying one or more of the
        following environment variables.

</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Notes
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                None of the variables below has any effect if the data
                directory you mount is not empty, as no server
                initialization is going to be attempted then (see
                <a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a>
                for more details). Any pre-existing contents in the
                folder, including any old server settings, are not
                modified during the container startup.
              </p></li><li class="listitem"><p>
                The boolean variables including
                <a class="link" href="installing.html#docker_var_mysql_random_root_password"><code class="option">MYSQL_RANDOM_ROOT_PASSWORD</code></a>,
                <a class="link" href="installing.html#docker_var_mysql_onetime_password"><code class="option">MYSQL_ONETIME_PASSWORD</code></a>,
                <a class="link" href="installing.html#docker_var_mysql-allow-empty-password"><code class="option">MYSQL_ALLOW_EMPTY_PASSWORD</code></a>,
                and
                <a class="link" href="installing.html#docker_var_mysql-log-console"><code class="option">MYSQL_LOG_CONSOLE</code></a>
                are made true by setting them with any strings of
                nonzero lengths.



                Therefore, setting them to, for example,
                <span class="quote">“<span class="quote">0</span>”</span>, <span class="quote">“<span class="quote">false</span>”</span>, or
                <span class="quote">“<span class="quote">no</span>”</span> does not make them false, but actually
                makes them true. This is a known issue of the MySQL
                Server containers.
</p></li></ul>
</div>

</div>
<p>
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="docker_var_mysql_random_root_password"></a>
            <a class="link" href="installing.html#docker_var_mysql_random_root_password"><code class="option">MYSQL_RANDOM_ROOT_PASSWORD</code></a>:
            When this variable is true (which is its default state,
            unless
            <a class="link" href="installing.html#docker_var_mysql-root-password"><code class="option">MYSQL_ROOT_PASSWORD</code></a>
            or
            <a class="link" href="installing.html#docker_var_mysql-allow-empty-password"><code class="option">MYSQL_ALLOW_EMPTY_PASSWORD</code></a>
            is set to true), a random password for the server's root
            user is generated when the Docker container is started. The
            password is printed to <code class="literal">stdout</code> of the
            container and can be found by looking at the container’s
            log (see <a class="xref" href="installing.html#docker-starting-mysql-server" title="Starting a MySQL Server Instance">Starting a MySQL Server Instance</a>).
          </p></li><li class="listitem"><p><a name="docker_var_mysql_onetime_password"></a>
            <a class="link" href="installing.html#docker_var_mysql_onetime_password"><code class="option">MYSQL_ONETIME_PASSWORD</code></a>:
            When the variable is true (which is its default state,
            unless
            <a class="link" href="installing.html#docker_var_mysql-root-password"><code class="option">MYSQL_ROOT_PASSWORD</code></a>
            is set or
            <a class="link" href="installing.html#docker_var_mysql-allow-empty-password"><code class="option">MYSQL_ALLOW_EMPTY_PASSWORD</code></a>
            is set to true), the root user's password is set as expired
            and must be changed before MySQL can be used normally.
          </p></li><li class="listitem"><p><a name="docker_var_mysql_database"></a>
            <a class="link" href="installing.html#docker_var_mysql_database"><code class="option">MYSQL_DATABASE</code></a>:
            This variable allows you to specify the name of a database
            to be created on image startup. If a user name and a
            password are supplied with
            <a class="link" href="installing.html#docker_var_mysql_user_password"><code class="option">MYSQL_USER</code></a>
            and
            <a class="link" href="installing.html#docker_var_mysql_user_password"><code class="option">MYSQL_PASSWORD</code></a>,
            the user is created and granted superuser access to this
            database (corresponding to <code class="literal">GRANT ALL</code>).
            The specified database is created by a
            <a class="link" href="sql-syntax.html#create-database" title="13.1.11 CREATE DATABASE Syntax">CREATE DATABASE IF NOT
            EXIST</a> statement, so that the variable has no effect
            if the database already exists.
          </p></li><li class="listitem"><p><a name="docker_var_mysql_user_password"></a>
            <a class="link" href="installing.html#docker_var_mysql_user_password"><code class="option">MYSQL_USER</code></a>,
            <a class="link" href="installing.html#docker_var_mysql_user_password"><code class="option">MYSQL_PASSWORD</code></a>:
            These variables are used in conjunction to create a user and
            set that user's password, and the user is granted superuser
            permissions for the database specified by the
            <a class="link" href="installing.html#docker_var_mysql_database"><code class="option">MYSQL_DATABASE</code></a>
            variable. Both
            <a class="link" href="installing.html#docker_var_mysql_user_password"><code class="option">MYSQL_USER</code></a>
            and
            <a class="link" href="installing.html#docker_var_mysql_user_password"><code class="option">MYSQL_PASSWORD</code></a>
            are required for a user to be created—if any of the
            two variables is not set, the other is ignored. If both
            variables are set but
            <a class="link" href="installing.html#docker_var_mysql_database"><code class="option">MYSQL_DATABASE</code></a>
            is not, the user is created without any privileges.

</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                There is no need to use this mechanism to create the
                root superuser, which is created by default with the
                password set by either one of the mechanisms discussed
                in the descriptions for
                <a class="link" href="installing.html#docker_var_mysql-root-password"><code class="option">MYSQL_ROOT_PASSWORD</code></a>
                and
                <a class="link" href="installing.html#docker_var_mysql_random_root_password"><code class="option">MYSQL_RANDOM_ROOT_PASSWORD</code></a>,
                unless
                <a class="link" href="installing.html#docker_var_mysql-allow-empty-password"><code class="option">MYSQL_ALLOW_EMPTY_PASSWORD</code></a>
                is true.
</p>
</div>
<p>
          </p></li><li class="listitem"><p><a name="docker_var_mysql-root-host"></a>
            <a class="link" href="installing.html#docker_var_mysql-root-host"><code class="option">MYSQL_ROOT_HOST</code></a>:
            By default, MySQL creates the
            <code class="literal">'root'@'localhost'</code> account. This account
            can only be connected to from inside the container as
            described in
            <a class="xref" href="installing.html#docker-connecting-within-container" title="Connecting to MySQL Server from within the Container">Connecting to MySQL Server from within the Container</a>. To
            allow root connections from other hosts, set this
            environment variable. For example, the value
            <code class="literal">172.17.0.1</code>, which is the default Docker
            gateway IP, allows connections from the host machine that
            runs the container. The option accepts only one entry, but
            wildcards are allowed (for example,
            <code class="option">MYSQL_ROOT_HOST=172.*.*.*</code> or
            <code class="option">MYSQL_ROOT_HOST=%</code>).
          </p></li><li class="listitem"><p><a name="docker_var_mysql-log-console"></a>
            <a class="link" href="installing.html#docker_var_mysql-log-console"><code class="option">MYSQL_LOG_CONSOLE</code></a>:
            When the variable is true (which is its default state for
            MySQL 8.0 server containers), the MySQL Server's error log
            is redirected to <code class="literal">stderr</code>, so that the
            error log goes into the Docker container's log and is
            viewable using the <span class="command"><strong>docker logs
            <em class="replaceable"><code>mysqld-container</code></em></strong></span>
            command.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              The variable has no effect if a server configuration file
              from the host has been mounted (see
              <a class="xref" href="installing.html#docker-persisting-data-configuration" title="Persisting Data and Configuration Changes">Persisting Data and Configuration Changes</a> on
              bind-mounting a configuration file).
</p>
</div>
</li><li class="listitem"><p><a name="docker_var_mysql-root-password"></a>
            <a class="link" href="installing.html#docker_var_mysql-root-password"><code class="option">MYSQL_ROOT_PASSWORD</code></a>:
            This variable specifies a password that is set for the MySQL
            root account.

</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
                Setting the MySQL root user password on the command line
                is insecure. As an alternative to specifying the
                password explicitly, you can set the variable with a
                container file path for a password file, and then mount
                a file from your host that contains the password at the
                container file path. This is still not very secure, as
                the location of the password file is still exposed. It
                is preferable to use the default settings of
                <a class="link" href="installing.html#docker_var_mysql_random_root_password"><code class="option">MYSQL_RANDOM_ROOT_PASSWORD=true</code></a>
                and
                <a class="link" href="installing.html#docker_var_mysql_onetime_password"><code class="option">MYSQL_ONETIME_PASSWORD=true</code></a>
                being both true.
</p>
</div>
<p>
          </p></li><li class="listitem"><p><a name="docker_var_mysql-allow-empty-password"></a>
            <a class="link" href="installing.html#docker_var_mysql-allow-empty-password"><code class="option">MYSQL_ALLOW_EMPTY_PASSWORD</code></a>.
            Set it to true to allow the container to be started with a
            blank password for the root user.

</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
                Setting this variable to true is insecure, because it is
                going to leave your MySQL instance completely
                unprotected, allowing anyone to gain complete superuser
                access. It is preferable to use the default settings of
                <a class="link" href="installing.html#docker_var_mysql_random_root_password"><code class="option">MYSQL_RANDOM_ROOT_PASSWORD=true</code></a>
                and
                <a class="link" href="installing.html#docker_var_mysql_onetime_password"><code class="option">MYSQL_ONETIME_PASSWORD=true</code></a>
                being both true.
</p>
</div>
<p>
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-native"></a>2.5.7 Installing MySQL on Linux from the Native Software Repositories</h3>

</div>

</div>

</div>
<p>
      Many Linux distributions include a version of the MySQL server,
      client tools, and development components in their native software
      repositories and can be installed with the platforms' standard
      package management systems. This section provides basic
      instructions for installing MySQL using those package management
      systems.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
        Native packages are often several versions behind the currently
        available release. You will also normally be unable to install
        development milestone releases (DMRs), as these are not usually
        made available in the native repositories. Before proceeding, we
        recommend that you check out the other installation options
        described in <a class="xref" href="installing.html#linux-installation" title="2.5 Installing MySQL on Linux">Section 2.5, “Installing MySQL on Linux”</a>.
</p>
</div>
<p>
      Distribution specific instructions are shown below:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <span class="bold"><strong>Red Hat Linux, Fedora, CentOS</strong></span>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            For a number of Linux distributions, you can install MySQL
            using the MySQL Yum repository instead of the platform's
            native software repository. See
            <a class="xref" href="installing.html#linux-installation-yum-repo" title="2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository">Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”</a> for details.
</p>
</div>
<p>
          For Red Hat and similar distributions, the MySQL distribution
          is divided into a number of separate packages,
          <code class="literal">mysql</code> for the client tools,
          <code class="literal">mysql-server</code> for the server and associated
          tools, and <code class="literal">mysql-libs</code> for the libraries.
          The libraries are required if you want to provide connectivity
          from different languages and environments such as Perl, Python
          and others.
        </p><p>
          To install, use the <span class="command"><strong>yum</strong></span> command to specify
          the packages that you want to install. For example:
        </p><pre data-lang="terminal" class="programlisting">
root-shell&gt; yum install mysql mysql-server mysql-libs mysql-server
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package mysql.x86_64 0:5.1.48-2.fc13 set to be updated
---&gt; Package mysql-libs.x86_64 0:5.1.48-2.fc13 set to be updated
---&gt; Package mysql-server.x86_64 0:5.1.48-2.fc13 set to be updated
--&gt; Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.48-2.fc13.x86_64
--&gt; Running transaction check
---&gt; Package perl-DBD-MySQL.x86_64 0:4.017-1.fc13 set to be updated
--&gt; Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch          Version               Repository      Size
================================================================================
Installing:
 mysql                 x86_64        5.1.48-2.fc13         updates        889 k
 mysql-libs            x86_64        5.1.48-2.fc13         updates        1.2 M
 mysql-server          x86_64        5.1.48-2.fc13         updates        8.1 M
Installing for dependencies:
 perl-DBD-MySQL        x86_64        4.017-1.fc13          updates        136 k

Transaction Summary
================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 10 M
Installed size: 30 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 10 M
(1/4): mysql-5.1.48-2.fc13.x86_64.rpm                    | 889 kB     00:04
(2/4): mysql-libs-5.1.48-2.fc13.x86_64.rpm               | 1.2 MB     00:06
(3/4): mysql-server-5.1.48-2.fc13.x86_64.rpm             | 8.1 MB     00:40
(4/4): perl-DBD-MySQL-4.017-1.fc13.x86_64.rpm            | 136 kB     00:00
--------------------------------------------------------------------------------
Total                                           201 kB/s |  10 MB     00:52
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : mysql-libs-5.1.48-2.fc13.x86_64                          1/4
  Installing     : mysql-5.1.48-2.fc13.x86_64                               2/4
  Installing     : perl-DBD-MySQL-4.017-1.fc13.x86_64                       3/4
  Installing     : mysql-server-5.1.48-2.fc13.x86_64                        4/4

Installed:
  mysql.x86_64 0:5.1.48-2.fc13            mysql-libs.x86_64 0:5.1.48-2.fc13
  mysql-server.x86_64 0:5.1.48-2.fc13

Dependency Installed:
  perl-DBD-MySQL.x86_64 0:4.017-1.fc13

Complete!
</pre><p>
          MySQL and the MySQL server should now be installed. A sample
          configuration file is installed into
          <code class="filename">/etc/my.cnf</code>. An init script, to start and
          stop the server, will have been installed into
          <code class="filename">/etc/init.d/mysqld</code>. To start the MySQL
          server use <span class="command"><strong>service</strong></span>:
        </p><pre data-lang="terminal" class="programlisting">
root-shell&gt; service mysqld start
</pre><p>
          To enable the server to be started and stopped automatically
          during boot, use <span class="command"><strong>chkconfig</strong></span>:
        </p><pre data-lang="terminal" class="programlisting">
root-shell&gt; chkconfig --levels 235 mysqld on
</pre><p>
          Which enables the MySQL server to be started (and stopped)
          automatically at the specified the run levels.
        </p><p>
          The database tables will have been automatically created for
          you, if they do not already exist. You should, however, run
          <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> to set the root
          passwords on your server.
        </p></li><li class="listitem"><p>
          <span class="bold"><strong>Debian, Ubuntu, Kubuntu</strong></span>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            For Debian 8 and Ubuntu 14 and 16, MySQL can be installed
            using the <a class="ulink" href="http://dev.mysql.com/downloads/repo/apt/" target="_top">MySQL
            APT Repository</a> instead of the platform's native
            software repository. See
            <a class="xref" href="installing.html#linux-installation-apt-repo" title="2.5.2 Installing MySQL on Linux Using the MySQL APT Repository">Section 2.5.2, “Installing MySQL on Linux Using the MySQL APT Repository”</a> for details.
</p>
</div>
<p>
          On Debian and related distributions, there are two packages
          for MySQL in their software repositories,
          <code class="literal">mysql-client</code> and
          <code class="literal">mysql-server</code>, for the client and server
          components respectively. You should specify an explicit
          version, for example <code class="literal">mysql-client-5.1</code>, to
          ensure that you install the version of MySQL that you want.
        </p><p>
          To download and install, including any dependencies, use the
          <span class="command"><strong>apt-get</strong></span> command, specifying the packages
          that you want to install.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Before installing, make sure that you update your
            <code class="literal">apt-get</code> index files to ensure you are
            downloading the latest available version.
</p>
</div>
<p>
          A sample installation of the MySQL packages might look like
          this (some sections trimmed for clarity):
        </p><pre data-lang="terminal" class="programlisting">
root-shell&gt; apt-get install mysql-client-5.1 mysql-server-5.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.28-11 linux-headers-2.6.28-11-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  bsd-mailx libdbd-mysql-perl libdbi-perl libhtml-template-perl
  libmysqlclient15off libmysqlclient16 libnet-daemon-perl libplrpc-perl mailx
  mysql-common postfix
Suggested packages:
  dbishell libipc-sharedcache-perl tinyca procmail postfix-mysql postfix-pgsql
  postfix-ldap postfix-pcre sasl2-bin resolvconf postfix-cdb
The following NEW packages will be installed
  bsd-mailx libdbd-mysql-perl libdbi-perl libhtml-template-perl
  libmysqlclient15off libmysqlclient16 libnet-daemon-perl libplrpc-perl mailx
  mysql-client-5.1 mysql-common mysql-server-5.1 postfix
0 upgraded, 13 newly installed, 0 to remove and 182 not upgraded.
Need to get 1907kB/25.3MB of archives.
After this operation, 59.5MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get: 1 http://gb.archive.ubuntu.com jaunty-updates/main mysql-common 5.1.30really5.0.75-0ubuntu10.5 [63.6kB]
Get: 2 http://gb.archive.ubuntu.com jaunty-updates/main libmysqlclient15off 5.1.30really5.0.75-0ubuntu10.5 [1843kB]
Fetched 1907kB in 9s (205kB/s)
Preconfiguring packages ...
Selecting previously deselected package mysql-common.
(Reading database ... 121260 files and directories currently installed.)
...
Processing 1 added doc-base file(s)...
Registering documents with scrollkeeper...
Setting up libnet-daemon-perl (0.43-1) ...
Setting up libplrpc-perl (0.2020-1) ...
Setting up libdbi-perl (1.607-1) ...
Setting up libmysqlclient15off (5.1.30really5.0.75-0ubuntu10.5) ...

Setting up libdbd-mysql-perl (4.008-1) ...
Setting up libmysqlclient16 (5.1.31-1ubuntu2) ...

Setting up mysql-client-5.1 (5.1.31-1ubuntu2) ...

Setting up mysql-server-5.1 (5.1.31-1ubuntu2) ...
 * Stopping MySQL database server mysqld
   ...done.
2013-09-24T13:03:09.048353Z 0 [Note] InnoDB: 8.0.13 started; log sequence number 1566036
2013-09-24T13:03:10.057269Z 0 [Note] InnoDB: Starting shutdown...
2013-09-24T13:03:10.857032Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1566036
 * Starting MySQL database server mysqld
   ...done.
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            The <span class="command"><strong>apt-get</strong></span> command will install a number
            of packages, including the MySQL server, in order to provide
            the typical tools and application environment. This can mean
            that you install a large number of packages in addition to
            the main MySQL package.
</p>
</div>
<p>
          During installation, the initial database will be created, and
          you will be prompted for the MySQL root password (and
          confirmation). A configuration file will have been created in
          <code class="filename">/etc/mysql/my.cnf</code>. An init script will
          have been created in <code class="filename">/etc/init.d/mysql</code>.
        </p><p>
          The server will already be started. You can manually start and
          stop the server using:
        </p><pre data-lang="terminal" class="programlisting">
root-shell&gt; service mysql [start|stop]
</pre><p>
          The service will automatically be added to the 2, 3 and 4 run
          levels, with stop scripts in the single, shutdown and restart
          levels.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="linux-installation-juju"></a>2.5.8 Installing MySQL on Linux with Juju</h3>

</div>

</div>

</div>
<p>
      The Juju deployment framework supports easy installation and
      configuration of MySQL servers. For instructions, see
      <a class="ulink" href="https://jujucharms.com/mysql/" target="_top">https://jujucharms.com/mysql/</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="using-systemd"></a>2.5.9 Managing MySQL Server with systemd</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899657367200"></a><p>
      If you install MySQL using an RPM or Debian package on the
      following Linux platforms, server startup and shutdown is managed
      by systemd:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          RPM package platforms:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              Red Hat Enterprise Linux 7; Oracle Linux 7; CentOS 7
            </p></li><li class="listitem"><p>
              SUSE Linux Enterprise Server 12
            </p></li><li class="listitem"><p>
              Fedora 26 and 27
</p></li></ul>
</div>
</li><li class="listitem"><p>
          Debian package platforms:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              Debian 8 or higher
            </p></li><li class="listitem"><p>
              Ubuntu 16 or higher
</p></li></ul>
</div>
</li></ul>
</div>
<p>
      If you install MySQL from a source distribution on a platform that
      uses systemd, obtain systemd support for MySQL by configuring the
      distribution using the
      <a class="link" href="installing.html#option_cmake_with_systemd"><code class="option">-DWITH_SYSTEMD=1</code></a>
      <span class="command"><strong>CMake</strong></span> option. See
      <a class="xref" href="installing.html#source-configuration-options" title="2.9.4 MySQL Source-Configuration Options">Section 2.9.4, “MySQL Source-Configuration Options”</a>.
    </p><p>
      The following discussion covers these topics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#systemd-overview" title="Overview of systemd">Overview of systemd</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#systemd-mysql-configuration" title="Configuring systemd for MySQL">Configuring systemd for MySQL</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#systemd-multiple-mysql-instances" title="Configuring Multiple MySQL Instances Using systemd">Configuring Multiple MySQL Instances Using systemd</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#mysqld-safe-to-systemd-migration" title="Migrating from mysqld_safe to systemd">Migrating from mysqld_safe to systemd</a></p></li></ul>
</div>

<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        On platforms for which systemd support for MySQL is installed,
        scripts such as <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> and the System V
        initialization script are unnecessary and are not installed. For
        example, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> can handle server
        restarts, but systemd provides the same capability, and does so
        in a manner consistent with management of other services rather
        than by using an application-specific program.
      </p><p>
        Because systemd has the capability of managing multiple MySQL
        instances on platforms for which systemd support for MySQL is
        installed, <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> and
        <span class="command"><strong>mysqld_multi.server</strong></span> are unnecessary and are
        not installed.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="systemd-overview"></a>Overview of systemd</h4>

</div>

</div>

</div>
<p>
        systemd provides automatic MySQL server startup and shutdown. It
        also enables manual server management using the
        <span class="command"><strong>systemctl</strong></span> command. For example:
      </p><pre data-lang="terminal" class="programlisting">
systemctl {start|stop|restart|status} mysqld
</pre><p>
        Alternatively, use the <span class="command"><strong>service</strong></span> command (with
        the arguments reversed), which is compatible with System V
        systems:
      </p><pre data-lang="terminal" class="programlisting">
service mysqld {start|stop|restart|status}
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          For the <span class="command"><strong>systemctl</strong></span> or
          <span class="command"><strong>service</strong></span> commands, if the MySQL service name
          is not <code class="literal">mysqld</code>, use the appropriate name.
          For example, use <code class="literal">mysql</code> rather than
          <code class="literal">mysqld</code> on Debian-based and SLES systems.
</p>
</div>
<p>
        Support for systemd includes these files:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="filename">mysqld.service</code> (RPM platforms),
            <code class="filename">mysql.service</code> (Debian platforms):
            systemd service unit configuration file, with details about
            the MySQL service.
          </p></li><li class="listitem"><p>
            <code class="filename">mysqld@.service</code> (RPM platforms),
            <code class="filename">mysql@.service</code> (Debian platforms): Like
            <code class="filename">mysqld.service</code> or
            <code class="filename">mysql.service</code>, but used for managing
            multiple MySQL instances.
          </p></li><li class="listitem"><p>
            <code class="filename">mysqld.tmpfiles.d</code>: File containing
            information to support the <code class="literal">tmpfiles</code>
            feature. This file is installed under the name
            <code class="filename">mysql.conf</code>.
          </p></li><li class="listitem"><p>
            <code class="filename">mysqld_pre_systemd</code> (RPM platforms),
            <code class="filename">mysql-system-start</code> (Debian platforms):
            Support script for the unit file. This script assists in
            creating the error log file only if the log location matches
            a pattern (<code class="literal">/var/log/mysql*.log</code> for RPM
            platforms, <code class="literal">/var/log/mysql/*.log</code> for
            Debian platforms). In other cases, the error log directory
            must be writable or the error log must be present and
            writable for the user running the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            process.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="systemd-mysql-configuration"></a>Configuring systemd for MySQL</h4>

</div>

</div>

</div>
<p>
        To add or change systemd options for MySQL, these methods are
        available:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Use a localized systemd configuration file.
          </p></li><li class="listitem"><p>
            Arrange for systemd to set environment variables for the
            MySQL server process.
          </p></li><li class="listitem"><p>
            Set the <code class="literal">MYSQLD_OPTS</code> systemd variable.
</p></li></ul>
</div>
<p>
        To use a localized systemd configuration file, create the
        <code class="filename">/etc/systemd/system/mysqld.service.d</code>
        directory if it does not exist. In that directory, create a file
        that contains a <code class="literal">[Service]</code> section listing the
        desired settings. For example:
      </p><pre data-lang="ini" class="programlisting">
[Service]
LimitNOFILE=<em class="replaceable"><code>max_open_files</code></em>
PIDFile=<em class="replaceable"><code>/path/to/pid/file</code></em>
Nice=<em class="replaceable"><code>nice_level</code></em>
LimitCore=<em class="replaceable"><code>core_file_limit</code></em>
Environment="LD_PRELOAD=<em class="replaceable"><code>/path/to/malloc/library</code></em>"
Environment="TZ=<em class="replaceable"><code>time_zone_setting</code></em>"
</pre><p>
        The discussion here uses <code class="filename">override.conf</code> as
        the name of this file. Newer versions of systemd support the
        following command, which opens an editor and permits you to edit
        the file:
      </p><pre data-lang="terminal" class="programlisting">
systemctl edit mysqld  # RPM platforms
systemctl edit mysql   # Debian platforms
</pre><p>
        Whenever you create or change
        <code class="filename">override.conf</code>, reload the systemd
        configuration, then tell systemd to restart the MySQL service:
      </p><pre data-lang="terminal" class="programlisting">
systemctl daemon-reload
systemctl restart mysqld  # RPM platforms
systemctl restart mysql   # Debian platforms
</pre><p>
        With systemd, the <code class="filename">override.conf</code>
        configuration method must be used for certain parameters, rather
        than settings in a <code class="literal">[mysqld]</code> or
        <code class="literal">[mysqld_safe]</code> group in a MySQL option file:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            For some parameters, <code class="filename">override.conf</code> must
            be used because systemd itself must know their values and it
            cannot read MySQL option files to get them.
          </p></li><li class="listitem"><p>
            Parameters that specify values otherwise settable only using
            options known to <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> must be
            specified using systemd because there is no corresponding
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> parameter.
</p></li></ul>
</div>
<p>
        For additional information about using systemd rather than
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>, see
        <a class="xref" href="installing.html#mysqld-safe-to-systemd-migration" title="Migrating from mysqld_safe to systemd">Migrating from mysqld_safe to systemd</a>.
      </p><p>
        You can set the following parameters in
        <code class="filename">override.conf</code>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            To specify the process ID file, use
            <code class="filename">override.conf</code> and change both
            <code class="literal">PIDFile</code> and <code class="literal">ExecStart</code>
            to name the PID file path name. Any setting of the process
            ID file in MySQL option files is ignored. To modify
            <code class="literal">ExecStart</code>, it must first be cleared. For
            example:
          </p><pre data-lang="ini" class="programlisting">
[Service]
PIDFile=/var/run/mysqld/mysqld-custom.pid
ExecStart=
ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld-custom.pid $MYSQLD_OPTS
</pre></li><li class="listitem"><p>
            To set the number of file descriptors available to the MySQL
            server, use <code class="literal">LimitNOFILE</code> in
            <code class="filename">override.conf</code> rather than the
            <a class="link" href="server-administration.html#option_mysqld_open-files-limit"><code class="option">--open-files-limit</code></a> option for
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> or <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>.
          </p></li><li class="listitem"><p>
            To set the maximum core file size, use
            <code class="literal">LimitCore</code> in
            <code class="filename">override.conf</code> rather than the
            <a class="link" href="programs.html#option_mysqld_safe_core-file-size"><code class="option">--core-file-size</code></a> option
            for <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>.
          </p></li><li class="listitem"><p>
            To set the scheduling priority for the MySQL server, use
            <code class="literal">Nice</code> in
            <code class="filename">override.conf</code> rather than the
            <a class="link" href="programs.html#option_mysqld_safe_nice"><code class="option">--nice</code></a> option for
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>.
</p></li></ul>
</div>
<p>
        Some MySQL parameters are configured using environment
        variables:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">LD_PRELOAD</code>: Set this variable if the
            MySQL server should use a specific memory-allocation
            library.
          </p><a class="indexterm" name="idm139899657267056"></a><a class="indexterm" name="idm139899657265968"></a><a class="indexterm" name="idm139899657264880"></a></li><li class="listitem"><p>
            <code class="literal">NOTIFY_SOCKET</code>: Set this variable to
            specify a socket for <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to use for
            communicating with systemd.
          </p><a class="indexterm" name="idm139899657260576"></a><a class="indexterm" name="idm139899657259488"></a></li><li class="listitem"><p>
            <code class="literal">TZ</code>: Set this variable to specify the
            default time zone for the server.
</p><a class="indexterm" name="idm139899657256416"></a><a class="indexterm" name="idm139899657255344"></a></li></ul>
</div>
<p>
        There are multiple ways to specify environment variable values
        for use by the MySQL server process managed by systemd:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Use <code class="literal">Environment</code> lines in the
            <code class="filename">override.conf</code> file. For the syntax, see
            the example in the preceding discussion that describes how
            to use this file.
          </p></li><li class="listitem"><p>
            Specify the values in the
            <code class="filename">/etc/sysconfig/mysql</code> file (create the
            file if it does not exist). Assign values using the
            following syntax:
          </p><pre data-lang="ini" class="programlisting">
LD_PRELOAD=<em class="replaceable"><code>/path/to/malloc/library</code></em>
TZ=<em class="replaceable"><code>time_zone_setting</code></em>
</pre><p>
            After modifying <code class="filename">/etc/sysconfig/mysql</code>,
            restart the server to make the changes effective:
          </p><pre data-lang="terminal" class="programlisting">
systemctl restart mysqld  # RPM platforms
systemctl restart mysql   # Debian platforms
</pre></li></ul>
</div>
<a class="indexterm" name="idm139899657244608"></a><a class="indexterm" name="idm139899657243520"></a><p>
        To specify options for <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> without
        modifying systemd configuration files directly, set or unset the
        <code class="literal">MYSQLD_OPTS</code> systemd variable. For example:
      </p><pre data-lang="terminal" class="programlisting">
systemctl set-environment MYSQLD_OPTS="--general_log=1"
systemctl unset-environment MYSQLD_OPTS
</pre><p>
        <code class="literal">MYSQLD_OPTS</code> can also be set in the
        <code class="filename">/etc/sysconfig/mysql</code> file.
      </p><p>
        After modifying the systemd environment, restart the server to
        make the changes effective:
      </p><pre data-lang="terminal" class="programlisting">
systemctl restart mysqld  # RPM platforms
systemctl restart mysql   # Debian platforms
</pre><p>
        For platforms that use systemd, the data directory is
        initialized if empty at server startup. This might be a problem
        if the data directory is a remote mount that has temporarily
        disappeared: The mount point would appear to be an empty data
        directory, which then would be initialized as a new data
        directory. To suppress this automatic initialization behavior,
        specify the following line in the
        <code class="filename">/etc/sysconfig/mysql</code> file (create the file
        if it does not exist):
      </p><pre data-lang="ini" class="programlisting">
NO_INIT=true
</pre>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="systemd-multiple-mysql-instances"></a>Configuring Multiple MySQL Instances Using systemd</h4>

</div>

</div>

</div>
<p>
        This section describes how to configure systemd for multiple
        instances of MySQL.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Because systemd has the capability of managing multiple MySQL
          instances on platforms for which systemd support is installed,
          <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> and
          <span class="command"><strong>mysqld_multi.server</strong></span> are unnecessary and are
          not installed.
</p>
</div>
<p>
        To use multiple-instance capability, modify the
        <code class="filename">my.cnf</code> option file to include configuration
        of key options for each instance. These file locations are
        typical:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="filename">/etc/my.cnf</code> or
            <code class="filename">/etc/mysql/my.cnf</code> (RPM platforms)
          </p></li><li class="listitem"><p>
            <code class="filename">/etc/mysql/mysql.conf.d/mysqld.cnf</code>
            (Debian platforms)
</p></li></ul>
</div>
<p>
        For example, to manage two instances named
        <code class="literal">replica01</code> and <code class="literal">replica02</code>,
        add something like this to the option file:
      </p><p>
        RPM platforms:
      </p><pre data-lang="ini" class="programlisting">
[mysqld@replica01]
datadir=/var/lib/mysql-replica01
socket=/var/lib/mysql-replica01/mysql.sock
port=3307
log-error=/var/log/mysqld-replica01.log

[mysqld@replica02]
datadir=/var/lib/mysql-replica02
socket=/var/lib/mysql-replica02/mysql.sock
port=3308
log-error=/var/log/mysqld-replica02.log
</pre><p>
        Debian platforms:
      </p><pre data-lang="ini" class="programlisting">
[mysqld@replica01]
datadir=/var/lib/mysql-replica01
socket=/var/lib/mysql-replica01/mysql.sock
port=3307
log-error=/var/log/mysql/replica01.log

[mysqld@replica02]
datadir=/var/lib/mysql-replica02
socket=/var/lib/mysql-replica02/mysql.sock
port=3308
log-error=/var/log/mysql/replica02.log
</pre><p>
        The replica names shown here use <code class="literal">@</code> as the
        delimiter because that is the only delimiter supported by
        systemd.
      </p><p>
        Instances then are managed by normal systemd commands, such as:
      </p><pre data-lang="terminal" class="programlisting">
systemctl start mysqld@replica01
systemctl start mysqld@replica02
</pre><p>
        To enable instances to run at boot time, do this:
      </p><pre data-lang="terminal" class="programlisting">
systemctl enable mysqld@replica01
systemctl enable mysqld@replica02
</pre><p>
        Use of wildcards is also supported. For example, this command
        displays the status of all replica instances:
      </p><pre data-lang="terminal" class="programlisting">
systemctl status 'mysqld@replica*'
</pre><p>
        For management of multiple MySQL instances on the same machine,
        systemd automatically uses a different unit file:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="filename">mysqld@.service</code> rather than
            <code class="filename">mysqld.service</code> (RPM platforms)
          </p></li><li class="listitem"><p>
            <code class="filename">mysql@.service</code> rather than
            <code class="filename">mysql.service</code> (Debian platforms)
</p></li></ul>
</div>
<p>
        In the unit file, <code class="literal">%I</code> and
        <code class="literal">%i</code> reference the parameter passed in after
        the <code class="literal">@</code> marker and are used to manage the
        specific instance. For a command such as this:
      </p><pre data-lang="terminal" class="programlisting">
systemctl start mysqld@replica01
</pre><p>
        systemd starts the server using a command such as this:
      </p><pre data-lang="terminal" class="programlisting">
mysqld --defaults-group-suffix=@%I ...
</pre><p>
        The result is that the <code class="literal">[server]</code>,
        <code class="literal">[mysqld]</code>, and
        <code class="literal">[mysqld@replica01]</code> option groups are read and
        used for that instance of the service.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          On Debian platforms, AppArmor prevents the server from reading
          or writing <code class="filename">/var/lib/mysql-replica*</code>, or
          anything other than the default locations. To address this,
          you must customize or disable the profile in
          <code class="filename">/etc/apparmor.d/usr.sbin.mysqld</code>.
</p>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
          On Debian platforms, the packaging scripts for MySQL
          uninstallation cannot currently handle
          <code class="literal">mysqld@</code> instances. Before removing or
          upgrading the package, you must stop any extra instances
          manually first.
</p>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="mysqld-safe-to-systemd-migration"></a>Migrating from mysqld_safe to systemd</h4>

</div>

</div>

</div>
<p>
        Because <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is not installed on
        platforms that use systemd to manage MySQL, options previously
        specified for that program (for example, in an
        <code class="literal">[mysqld_safe]</code> option group) must be specified
        another way:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Some <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> options are also
            understood by <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> and can be moved
            from the <code class="literal">[mysqld_safe]</code> option group to
            the <code class="literal">[mysqld]</code> group. This does
            <span class="emphasis"><em>not</em></span> include
            <a class="link" href="programs.html#option_mysqld_safe_pid-file"><code class="option">--pid-file</code></a>,
            <a class="link" href="programs.html#option_mysqld_safe_open-files-limit"><code class="option">--open-files-limit</code></a>, or
            <a class="link" href="programs.html#option_mysqld_safe_nice"><code class="option">--nice</code></a>. To specify those
            options, use the <code class="filename">override.conf</code> systemd
            file, described previously.
          </p></li><li class="listitem"><p>
            For some <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> options, there are
            alternative <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> procedures. For
            example, the <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> option for
            enabling <code class="literal">syslog</code> logging is
            <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--syslog</code></a>, which is
            deprecated. To write error log output to the system log, use
            the instructions at <a class="xref" href="server-administration.html#error-log-syslog" title="5.4.2.3 Error Logging to the System Log">Section 5.4.2.3, “Error Logging to the System Log”</a>.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> options not understood by
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> can be specified in
            <code class="filename">override.conf</code> or environment variables.
            For example, with <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>, if the
            server should use a specific memory allocation library, this
            is specified using the
            <a class="link" href="programs.html#option_mysqld_safe_malloc-lib"><code class="option">--malloc-lib</code></a> option. For
            installations that manage the server with systemd, arrange
            to set the <code class="literal">LD_PRELOAD</code> environment
            variable instead, as described previously.
</p></li></ul>
</div>

</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="uln-installation"></a>2.6 Installing MySQL Using Unbreakable Linux Network (ULN)</h2>

</div>

</div>

</div>
<p>
    Linux supports a number of different solutions for installing MySQL,
    covered in <a class="xref" href="installing.html#linux-installation" title="2.5 Installing MySQL on Linux">Section 2.5, “Installing MySQL on Linux”</a>. One of the methods,
    covered in this section, is installing from Oracle's Unbreakable
    Linux Network (ULN). You can find information about Oracle Linux and
    ULN under <a class="ulink" href="http://linux.oracle.com/" target="_top">http://linux.oracle.com/</a>.
  </p><p>
    To use ULN, you need to obtain a ULN login and register the machine
    used for installation with ULN. This is described in detail in the
    <a class="ulink" href="https://linux.oracle.com/uln_faq.html" target="_top">ULN FAQ</a>.
    The page also describes how to install and update packages.The MySQL
    packages are in the <span class="quote">“<span class="quote">MySQL for Oracle Linux 6</span>”</span> and
    <span class="quote">“<span class="quote">MySQL for Oracle Linux 7</span>”</span> channels for your system
    architecture on ULN.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      At the time of this writing, ULN provides MySQL 8.0
      for Oracle Linux 6 and Oracle Linux 7.
</p>
</div>
<p>
    Once MySQL has been installed using ULN, you can find information on
    starting and stopping the server, and more, in
    <a class="link" href="installing.html#linux-installation-native" title="2.5.7 Installing MySQL on Linux from the Native Software Repositories">this section</a>,
    particularly under <a class="xref" href="installing.html#linux-installation-rpm" title="2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle">Section 2.5.4, “Installing MySQL on Linux Using RPM Packages from Oracle”</a>.
  </p><p>
    If you're updating an existing MySQL installation to an installation
    using ULN, the recommended procedure is to export your data using
    <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>, remove the existing installation,
    install MySQL from ULN, and load the exported data into your freshly
    installed MySQL.
  </p><p>
    If the existing MySQL installation you're upgrading from is from a
    previous release series (prior to MySQL 8.0), make sure
    to read the section on upgrading MySQL, <a class="xref" href="installing.html#upgrading" title="2.11.1 Upgrading MySQL">Section 2.11.1, “Upgrading MySQL”</a>.
</p>
</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="solaris-installation"></a>2.7 Installing MySQL on Solaris</h2>

</div>

</div>

</div>

<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#solaris-installation-pkg">2.7.1 Installing MySQL on Solaris Using a Solaris PKG</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899657152800"></a><a class="indexterm" name="idm139899657151344"></a><a class="indexterm" name="idm139899657149888"></a><a class="indexterm" name="idm139899657148400"></a><a class="indexterm" name="idm139899657147312"></a><a class="indexterm" name="idm139899657145824"></a><a class="indexterm" name="idm139899657144368"></a><a class="indexterm" name="idm139899657142880"></a><a class="indexterm" name="idm139899657141808"></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      MySQL 8.0 supports Solaris 11 (Update 3+ and later).
</p>
</div>
<p>
    MySQL on Solaris is available in a number of different formats.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        For information on installing using the native Solaris PKG
        format, see <a class="xref" href="installing.html#solaris-installation-pkg" title="2.7.1 Installing MySQL on Solaris Using a Solaris PKG">Section 2.7.1, “Installing MySQL on Solaris Using a Solaris PKG”</a>.
      </p></li><li class="listitem"><p>
        To use a standard <code class="literal">tar</code> binary installation,
        use the notes provided in <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
        Check the notes and hints at the end of this section for Solaris
        specific notes that you may need before or after installation.
</p></li></ul>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
      The installation packages have a dependency on the Oracle
      Developer Studio 12.5 Runtime Libraries, which must be installed
      before you run the MySQL installation package. See the download
      options for Oracle Developer Studio
      <a class="ulink" href="http://www.oracle.com/technetwork/server-storage/developerstudio/downloads/index.html" target="_top">here</a>.
      The installation package enables you to install the runtime
      libraries only instead of the full Oracle Developer Studio; see
      instructions in
      <a class="ulink" href="https://docs.oracle.com/cd/E60778_01/html/E60743/gozsu.html#scrolltoc" target="_top">Installing
      Only the Runtime Libraries on Oracle Solaris 11</a>.
</p>
</div>
<p>
    To obtain a binary MySQL distribution for Solaris in tarball or PKG
    format,
    <a class="ulink" href="http://dev.mysql.com/downloads/mysql/8.0.html" target="_top">http://dev.mysql.com/downloads/mysql/8.0.html</a>.
  </p><p>
    Additional notes to be aware of when installing and using MySQL on
    Solaris:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        If you want to use MySQL with the <code class="literal">mysql</code> user
        and group, use the <span class="command"><strong>groupadd</strong></span> and
        <span class="command"><strong>useradd</strong></span> commands:
      </p><pre data-lang="terminal" class="programlisting">
groupadd mysql
useradd -g mysql -s /bin/false mysql
</pre></li><li class="listitem"><p>
        If you install MySQL using a binary tarball distribution on
        Solaris, because the Solaris <span class="command"><strong>tar</strong></span> cannot
        handle long file names, use GNU <span class="command"><strong>tar</strong></span>
        (<span class="command"><strong>gtar</strong></span>) to unpack the distribution. If you do
        not have GNU <span class="command"><strong>tar</strong></span> on your system, install it
        with the following command:
      </p><pre data-lang="terminal" class="programlisting">
pkg install archiver/gnu-tar
</pre></li><li class="listitem"><p>
        You should mount any file systems on which you intend to store
        <code class="literal">InnoDB</code> files with the
        <code class="literal">forcedirectio</code> option. (By default mounting is
        done without this option.) Failing to do so will cause a
        significant drop in performance when using the
        <code class="literal">InnoDB</code> storage engine on this platform.
      </p></li><li class="listitem"><p>
        If you would like MySQL to start automatically, you can copy
        <code class="filename">support-files/mysql.server</code> to
        <code class="filename">/etc/init.d</code> and create a symbolic link to
        it named <code class="filename">/etc/rc3.d/S99mysql.server</code>.
      </p></li><li class="listitem"><p>
        If too many processes try to connect very rapidly to
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, you should see this error in the
        MySQL log:
      </p><pre data-lang="simple" class="programlisting">
Error in accept: Protocol error
</pre><p>
        You might try starting the server with the
        <a class="link" href="server-administration.html#sysvar_back_log"><code class="option">--back_log=50</code></a> option as a
        workaround for this.
      </p></li><li class="listitem"><p>
        To configure the generation of core files on Solaris you should
        use the <span class="command"><strong>coreadm</strong></span> command. Because of the
        security implications of generating a core on a
        <code class="literal">setuid()</code> application, by default, Solaris
        does not support core files on <code class="literal">setuid()</code>
        programs. However, you can modify this behavior using
        <span class="command"><strong>coreadm</strong></span>. If you enable
        <code class="literal">setuid()</code> core files for the current user,
        they will be generated using the mode 600 and owned by the
        superuser.
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="solaris-installation-pkg"></a>2.7.1 Installing MySQL on Solaris Using a Solaris PKG</h3>

</div>

</div>

</div>
<p>
      You can install MySQL on Solaris using a binary package of the
      native Solaris PKG format instead of the binary tarball
      distribution.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
        The installation package has a dependency on the Oracle
        Developer Studio 12.5 Runtime Libraries, which must be installed
        before you run the MySQL installation package. See the download
        options for Oracle Developer Studio
        <a class="ulink" href="http://www.oracle.com/technetwork/server-storage/developerstudio/downloads/index.html" target="_top">here</a>.
        The installation package enables you to install the runtime
        libraries only instead of the full Oracle Developer Studio; see
        instructions in
        <a class="ulink" href="https://docs.oracle.com/cd/E60778_01/html/E60743/gozsu.html#scrolltoc" target="_top">Installing
        Only the Runtime Libraries on Oracle Solaris 11</a>.
</p>
</div>
<p>
      To use this package, download the corresponding
      <code class="filename">mysql-VERSION-solaris11-PLATFORM.pkg.gz</code> file,
      then uncompress it. For example:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gunzip mysql-<em class="replaceable"><code>8.0.13</code></em>-solaris11-x86_64.pkg.gz</code></strong>
</pre><p>
      To install a new package, use <span class="command"><strong>pkgadd</strong></span> and follow
      the onscreen prompts. You must have root privileges to perform
      this operation:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>pkgadd -d mysql-<em class="replaceable"><code>8.0.13</code></em>-solaris11-x86_64.pkg</code></strong>

The following packages are available:
  1  mysql     MySQL Community Server (GPL)
               (i86pc) 8.0.13

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:
</pre><p>
      The PKG installer installs all of the files and tools needed, and
      then initializes your database if one does not exist. To complete
      the installation, you should set the root password for MySQL as
      provided in the instructions at the end of the installation.
      Alternatively, you can run the
      <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> script that comes
      with the installation.
    </p><p>
      By default, the PKG package installs MySQL under the root path
      <code class="filename">/opt/mysql</code>. You can change only the
      installation root path when using <span class="command"><strong>pkgadd</strong></span>, which
      can be used to install MySQL in a different Solaris zone. If you
      need to install in a specific directory, use a binary
      <span class="command"><strong>tar</strong></span> file distribution.
    </p><p>
      The <code class="literal">pkg</code> installer copies a suitable startup
      script for MySQL into <code class="literal">/etc/init.d/mysql</code>. To
      enable MySQL to startup and shutdown automatically, you should
      create a link between this file and the init script directories.
      For example, to ensure safe startup and shutdown of MySQL you
      could use the following commands to add the right links:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>ln /etc/init.d/mysql /etc/rc3.d/S91mysql</code></strong>
shell&gt; <strong class="userinput"><code>ln /etc/init.d/mysql /etc/rc0.d/K02mysql</code></strong>
</pre><p>
      To remove MySQL, the installed package name is
      <code class="literal">mysql</code>. You can use this in combination with the
      <span class="command"><strong>pkgrm</strong></span> command to remove the installation.
    </p><p>
      To upgrade when using the Solaris package file format, you must
      remove the existing installation before installing the updated
      package. Removal of the package does not delete the existing
      database information, only the server, binaries and support files.
      The typical upgrade sequence is therefore:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysqladmin shutdown</code></strong>
shell&gt; <strong class="userinput"><code>pkgrm mysql</code></strong>
shell&gt; <strong class="userinput"><code>pkgadd -d mysql-<em class="replaceable"><code>8.0.13</code></em>-solaris11-x86_64.pkg</code></strong>
shell&gt; <strong class="userinput"><code>mysqld_safe &amp;</code></strong>
shell&gt; <strong class="userinput"><code>mysql_upgrade</code></strong>
</pre><p>
      You should check the notes in
      <a class="xref" href="installing.html#upgrading-downgrading" title="2.11 Upgrading or Downgrading MySQL">Section 2.11, “Upgrading or Downgrading MySQL”</a> before performing any
      upgrade.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="freebsd-installation"></a>2.8 Installing MySQL on FreeBSD</h2>

</div>

</div>

</div>
<p>
    This section provides information about installing MySQL on variants
    of FreeBSD Unix.
  </p><p>
    You can install MySQL on FreeBSD by using the binary distribution
    provided by Oracle. For more information, see
    <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
  </p><p>
    The easiest (and preferred) way to install MySQL is to use the
    <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql-server</strong></span></a> and <code class="literal">mysql-client</code>
    ports available at <a class="ulink" href="http://www.freebsd.org/" target="_top">http://www.freebsd.org/</a>. Using
    these ports gives you the following benefits:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        A working MySQL with all optimizations enabled that are known to
        work on your version of FreeBSD.
      </p></li><li class="listitem"><p>
        Automatic configuration and build.
      </p></li><li class="listitem"><p>
        Startup scripts installed in
        <code class="filename">/usr/local/etc/rc.d</code>.
      </p></li><li class="listitem"><p>
        The ability to use <code class="literal">pkg_info -L</code> to see which
        files are installed.
      </p></li><li class="listitem"><p>
        The ability to use <code class="literal">pkg_delete</code> to remove MySQL
        if you no longer want it on your machine.
</p></li></ul>
</div>
<p>
    The MySQL build process requires GNU make (<span class="command"><strong>gmake</strong></span>)
    to work. If GNU <span class="command"><strong>make</strong></span> is not available, you must
    install it first before compiling MySQL.
  </p><p>
    To install using the ports system:
  </p><pre data-lang="terminal" class="programlisting">
# cd /usr/ports/databases/mysql80-server
# make
...
# cd /usr/ports/databases/mysql80-client
# make
...
</pre><p>
    The standard port installation places the server into
    <code class="filename">/usr/local/libexec/mysqld</code>, with the startup
    script for the MySQL server placed in
    <code class="filename">/usr/local/etc/rc.d/mysql-server</code>.
  </p><p>
    Some additional notes on the BSD implementation:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        To remove MySQL after installation using the ports system:
      </p><pre data-lang="terminal" class="programlisting">
# cd /usr/ports/databases/mysql80-server
# make deinstall
...
# cd /usr/ports/databases/mysql80-client
# make deinstall
...
</pre></li><li class="listitem"><p>
        If you get problems with the current date in MySQL, setting the
        <code class="literal">TZ</code> variable should help. See
        <a class="xref" href="programs.html#environment-variables" title="4.9 MySQL Program Environment Variables">Section 4.9, “MySQL Program Environment Variables”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="source-installation"></a>2.9 Installing MySQL from Source</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#source-installation-layout">2.9.1 MySQL Layout for Source Installation</a></span></dt><dt><span class="section"><a href="installing.html#installing-source-distribution">2.9.2 Installing MySQL Using a Standard Source Distribution</a></span></dt><dt><span class="section"><a href="installing.html#installing-development-tree">2.9.3 Installing MySQL Using a Development Source Tree</a></span></dt><dt><span class="section"><a href="installing.html#source-configuration-options">2.9.4 MySQL Source-Configuration Options</a></span></dt><dt><span class="section"><a href="installing.html#compilation-problems">2.9.5 Dealing with Problems Compiling MySQL</a></span></dt><dt><span class="section"><a href="installing.html#source-configuration-third-party">2.9.6 MySQL Configuration and Third-Party Tools</a></span></dt><dt><span class="section"><a href="installing.html#source-installation-doxygen">2.9.7 Generating MySQL Doxygen Documentation Content</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899657050336"></a><a class="indexterm" name="idm139899657048880"></a><a class="indexterm" name="idm139899657047392"></a><p>
    Building MySQL from the source code enables you to customize build
    parameters, compiler optimizations, and installation location. For a
    list of systems on which MySQL is known to run, see
    <a class="ulink" href="http://www.mysql.com/support/supportedplatforms/database.html" target="_top">http://www.mysql.com/support/supportedplatforms/database.html</a>.
  </p><p>
    Before you proceed with an installation from source, check whether
    Oracle produces a precompiled binary distribution for your platform
    and whether it works for you. We put a great deal of effort into
    ensuring that our binaries are built with the best possible options
    for optimal performance. Instructions for installing binary
    distributions are available in
    <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
      Building MySQL with nonstandard options may lead to reduced
      functionality, performance, or security.
</p>
</div>
<p>
    The MySQL source code contains internal documentation written using
    Doxygen. The generated Doxygen content is available at
    <a class="ulink" href="http://dev.mysql.com/doc/dev/mysql-server/latest/" target="_top">http://dev.mysql.com/doc/dev/mysql-server/latest/</a>. It is also possible
    to generate this content locally from a MySQL source distribution
    using the instructions at
    <a class="xref" href="installing.html#source-installation-doxygen" title="2.9.7 Generating MySQL Doxygen Documentation Content">Section 2.9.7, “Generating MySQL Doxygen Documentation Content”</a>.
</p>
<h3><a name="idm139899657040752"></a>Source Installation Methods</h3>
<p>
    There are two methods for installing MySQL from source:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        Use a standard MySQL source distribution. To obtain a standard
        distribution, see <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>. For
        instructions on building from a standard distribution, see
        <a class="xref" href="installing.html#installing-source-distribution" title="2.9.2 Installing MySQL Using a Standard Source Distribution">Section 2.9.2, “Installing MySQL Using a Standard Source Distribution”</a>.
      </p><p>
        Standard distributions are available as compressed
        <span class="command"><strong>tar</strong></span> files, Zip archives, or RPM packages.
        Distribution files have names of the form
        <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>.tar.gz</code>,
        <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>.zip</code>,
        or
        <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em>.rpm</code>,
        where <em class="replaceable"><code>VERSION</code></em> is a number like
        <code class="literal">8.0.13</code>. File names for source
        distributions can be distinguished from those for precompiled
        binary distributions in that source distribution names are
        generic and include no platform name, whereas binary
        distribution names include a platform name indicating the type
        of system for which the distribution is intended (for example,
        <code class="literal">pc-linux-i686</code> or <code class="literal">winx64</code>).
      </p></li><li class="listitem"><p>
        Use a MySQL development tree. For information on building from
        one of the development trees, see
        <a class="xref" href="installing.html#installing-development-tree" title="2.9.3 Installing MySQL Using a Development Source Tree">Section 2.9.3, “Installing MySQL Using a Development Source Tree”</a>.
</p></li></ul>
</div>
<h3><a name="idm139899657027360"></a>Source Installation System Requirements</h3>
<p>
    Installation of MySQL from source requires several development
    tools. Some of these tools are needed no matter whether you use a
    standard source distribution or a development source tree. Other
    tool requirements depend on which installation method you use.
  </p><p>
    To install MySQL from source, the following system requirements must
    be satisfied, regardless of installation method:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        <span class="command"><strong>CMake</strong></span>, which is used as the build framework
        on all platforms. <span class="command"><strong>CMake</strong></span> can be downloaded
        from <a class="ulink" href="http://www.cmake.org" target="_top">http://www.cmake.org</a>.
      </p></li><li class="listitem"><p>
        A good <span class="command"><strong>make</strong></span> program. Although some platforms
        come with their own <span class="command"><strong>make</strong></span> implementations, it
        is highly recommended that you use GNU <span class="command"><strong>make</strong></span>
        3.75 or higher. It may already be available on your system as
        <span class="command"><strong>gmake</strong></span>. GNU <span class="command"><strong>make</strong></span> is
        available from <a class="ulink" href="http://www.gnu.org/software/make/" target="_top">http://www.gnu.org/software/make/</a>.
      </p></li><li class="listitem"><p>
        MySQL 8.0 source code permits use of C++11
        features. To enable a good level of C++11 support across all
        supported platforms, the following minimum compiler versions
        apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
            GCC: 4.8 or higher
          </p></li><li class="listitem"><p>
            Clang: 3.4 or higher (Xcode 7 on macOS)
          </p></li><li class="listitem"><p>
            Solaris Studio: 12.4 or higher (Solaris client build only)
          </p></li><li class="listitem"><p>
            Visual Studio: 2015
          </p></li><li class="listitem"><p>
            CMake: On Windows, the required Visual Studio version
            results in a required CMake version of 3.2.3 or higher
</p></li></ul>
</div>
</li><li class="listitem"><p>
        The MySQL C API requires a C++ or C99 compiler to compile.
      </p></li><li class="listitem"><p>
        The Boost C++ libraries are required to build MySQL (but not to
        use it). The current version of Boost must be installed. To
        obtain Boost and its installation instructions, visit
        <a class="ulink" href="http://www.boost.org" target="_top">the official site</a>.
        After Boost is installed, tell the build system where the Boost
        files are located by defining the
        <a class="link" href="installing.html#option_cmake_with_boost"><code class="option">WITH_BOOST</code></a> option when you invoke
        <span class="command"><strong>CMake</strong></span>. For example:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake . -DWITH_BOOST=/usr/local/boost_<em class="replaceable"><code>version_number</code></em></code></strong>
</pre><p>
        Adjust the path as necessary to match your installation.
      </p></li><li class="listitem"><p>
        The
        <a class="ulink" href="https://www.gnu.org/software/ncurses/ncurses.html" target="_top">ncurses</a>
        library.
      </p></li><li class="listitem"><p>
        Sufficient free memory. If you encounter problems such as
        <span class="quote">“<span class="quote">internal compiler error</span>”</span> when compiling large
        source files, it may be that you have too little memory. If
        compiling on a virtual machine, try increasing the memory
        allocation.
      </p></li><li class="listitem"><p>
        Perl is needed if you intend to run test scripts. Most Unix-like
        systems include Perl. On Windows, you can use a version such as
        ActiveState Perl.
</p></li></ul>
</div>
<p>
    To install MySQL from a standard source distribution, one of the
    following tools is required to unpack the distribution file:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        For a <code class="filename">.tar.gz</code> compressed
        <span class="command"><strong>tar</strong></span> file: GNU <code class="literal">gunzip</code> to
        uncompress the distribution and a reasonable
        <span class="command"><strong>tar</strong></span> to unpack it. If your
        <span class="command"><strong>tar</strong></span> program supports the <code class="literal">z</code>
        option, it can both uncompress and unpack the file.
      </p><p>
        GNU <span class="command"><strong>tar</strong></span> is known to work. The standard
        <span class="command"><strong>tar</strong></span> provided with some operating systems is
        not able to unpack the long file names in the MySQL
        distribution. You should download and install GNU
        <span class="command"><strong>tar</strong></span>, or if available, use a preinstalled
        version of GNU tar. Usually this is available as
        <span class="command"><strong>gnutar</strong></span>, <span class="command"><strong>gtar</strong></span>, or as
        <span class="command"><strong>tar</strong></span> within a GNU or Free Software directory,
        such as <code class="filename">/usr/sfw/bin</code> or
        <code class="filename">/usr/local/bin</code>. GNU <span class="command"><strong>tar</strong></span>
        is available from
        <a class="ulink" href="http://www.gnu.org/software/tar/" target="_top">http://www.gnu.org/software/tar/</a>.
      </p></li><li class="listitem"><p>
        For a <code class="filename">.zip</code> Zip archive:
        <span class="command"><strong>WinZip</strong></span> or another tool that can read
        <code class="filename">.zip</code> files.
      </p></li><li class="listitem"><p>
        For an <code class="filename">.rpm</code> RPM package: The
        <span class="command"><strong>rpmbuild</strong></span> program used to build the
        distribution unpacks it.
</p></li></ul>
</div>
<p>
    To install MySQL from a development source tree, the following
    additional tools are required:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        The Git revision control system is required to obtain the
        development source code. The
        <a class="ulink" href="https://help.github.com/" target="_top">GitHub Help</a>
        provides instructions for downloading and installing Git on
        different platforms. MySQL officially joined GitHub in
        September, 2014. For more information about MySQL's move to
        GitHub, refer to the announcement on the MySQL Release
        Engineering blog:
        <a class="ulink" href="http://mysqlrelease.com/2014/09/mysql-on-github/" target="_top">MySQL
        on GitHub</a>
      </p></li><li class="listitem"><p>
        <span class="command"><strong>bison</strong></span> 2.1 or higher, available from
        <a class="ulink" href="http://www.gnu.org/software/bison/" target="_top">http://www.gnu.org/software/bison/</a>. (Version 1 is
        no longer supported.) Use the latest version of
        <span class="command"><strong>bison</strong></span> where possible; if you experience
        problems, upgrade to a later version, rather than revert to an
        earlier one.
      </p><p>
        <span class="command"><strong>bison</strong></span> is available from
        <a class="ulink" href="http://www.gnu.org/software/bison/" target="_top">http://www.gnu.org/software/bison/</a>.
        <code class="literal">bison</code> for Windows can be downloaded from
        <a class="ulink" href="http://gnuwin32.sourceforge.net/packages/bison.htm" target="_top">http://gnuwin32.sourceforge.net/packages/bison.htm</a>.
        Download the package labeled <span class="quote">“<span class="quote">Complete package, excluding
        sources</span>”</span>. On Windows, the default location for
        <span class="command"><strong>bison</strong></span> is the <code class="filename">C:\Program
        Files\GnuWin32</code> directory. Some utilities may fail to
        find <span class="command"><strong>bison</strong></span> because of the space in the
        directory name. Also, Visual Studio may simply hang if there are
        spaces in the path. You can resolve these problems by installing
        into a directory that does not contain a space; for example
        <code class="filename">C:\GnuWin32</code>.
      </p></li><li class="listitem"><p>
        On Solaris Express, <span class="command"><strong>m4</strong></span> must be installed in
        addition to <span class="command"><strong>bison</strong></span>. <span class="command"><strong>m4</strong></span> is
        available from <a class="ulink" href="http://www.gnu.org/software/m4/" target="_top">http://www.gnu.org/software/m4/</a>.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
      If you have to install any programs, modify your
      <code class="literal">PATH</code> environment variable to include any
      directories in which the programs are located. See
      <a class="xref" href="programs.html#setting-environment-variables" title="4.2.10 Setting Environment Variables">Section 4.2.10, “Setting Environment Variables”</a>.
</p>
</div>
<p>
    If you run into problems and need to file a bug report, please use
    the instructions in <a class="xref" href="introduction.html#bug-reports" title="1.7 How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="source-installation-layout"></a>2.9.1 MySQL Layout for Source Installation</h3>
</div>
</div>
</div>
<p>
      By default, when you install MySQL after compiling it from source,
      the installation step installs files under
      <code class="filename">/usr/local/mysql</code>. The component locations
      under the installation directory are the same as for binary
      distributions. See <a class="xref" href="installing.html#binary-installation-layout" title="Table 2.3 MySQL Installation Layout for Generic Unix/Linux Binary Package">Table 2.3, “MySQL Installation Layout for Generic Unix/Linux Binary Package”</a>,
      and <a class="xref" href="installing.html#windows-installation-layout" title="2.3.1 MySQL Installation Layout on Microsoft Windows">Section 2.3.1, “MySQL Installation Layout on Microsoft Windows”</a>. To configure
      installation locations different from the defaults, use the
      options described at
      <a class="xref" href="installing.html#source-configuration-options" title="2.9.4 MySQL Source-Configuration Options">Section 2.9.4, “MySQL Source-Configuration Options”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="installing-source-distribution"></a>2.9.2 Installing MySQL Using a Standard Source Distribution</h3>

</div>

</div>

</div>
<p>
      To install MySQL from a standard source distribution:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Verify that your system satisfies the tool requirements listed
          at <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
        </p></li><li class="listitem"><p>
          Obtain a distribution file using the instructions in
          <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>.
        </p></li><li class="listitem"><p>
          Configure, build, and install the distribution using the
          instructions in this section.
        </p></li><li class="listitem"><p>
          Perform postinstallation procedures using the instructions in
          <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>.
</p></li></ol>
</div>
<p>
      In MySQL 8.0, <span class="command"><strong>CMake</strong></span> is used as the
      build framework on all platforms. The instructions given here
      should enable you to produce a working installation. For
      additional information on using <span class="command"><strong>CMake</strong></span> to build
      MySQL, see <a class="ulink" href="http://dev.mysql.com/doc/internals/en/cmake.html" target="_top">How to
      Build MySQL Server with CMake</a>.
    </p><p>
      If you start from a source RPM, use the following command to make
      a binary RPM that you can install. If you do not have
      <span class="command"><strong>rpmbuild</strong></span>, use <span class="command"><strong>rpm</strong></span> instead.
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>rpmbuild --rebuild --clean MySQL-<em class="replaceable"><code>VERSION</code></em>.src.rpm</code></strong>
</pre><p>
      The result is one or more binary RPM packages that you install as
      indicated in <a class="xref" href="installing.html#linux-installation-rpm" title="2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle">Section 2.5.4, “Installing MySQL on Linux Using RPM Packages from Oracle”</a>.
    </p><p>
      The sequence for installation from a compressed
      <span class="command"><strong>tar</strong></span> file or Zip archive source distribution is
      similar to the process for installing from a generic binary
      distribution (see <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>), except
      that it is used on all platforms and includes steps to configure
      and compile the distribution. For example, with a compressed
      <span class="command"><strong>tar</strong></span> file source distribution on Unix, the basic
      installation command sequence looks like this:
    </p><pre data-lang="terminal" class="programlisting">
# Preconfiguration setup
shell&gt; <strong class="userinput"><code>groupadd mysql</code></strong>
shell&gt; <strong class="userinput"><code>useradd -r -g mysql -s /bin/false mysql</code></strong>
# Beginning of source-build specific instructions
shell&gt; <strong class="userinput"><code>tar zxvf mysql-<em class="replaceable"><code>VERSION</code></em>.tar.gz</code></strong>
shell&gt; <strong class="userinput"><code>cd mysql-<em class="replaceable"><code>VERSION</code></em></code></strong>
shell&gt; <strong class="userinput"><code>mkdir bld</code></strong>
shell&gt; <strong class="userinput"><code>cd bld</code></strong>
shell&gt; <strong class="userinput"><code>cmake ..</code></strong>
shell&gt; <strong class="userinput"><code>make</code></strong>
shell&gt; <strong class="userinput"><code>make install</code></strong>
# End of source-build specific instructions
# Postinstallation setup
shell&gt; <strong class="userinput"><code>cd /usr/local/mysql</code></strong>
shell&gt; <strong class="userinput"><code>mkdir mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>chown mysql:mysql mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>chmod 750 mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqld --initialize --user=mysql</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysql_ssl_rsa_setup</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqld_safe --user=mysql &amp;</code></strong>
# Next command is optional
shell&gt; <strong class="userinput"><code>cp support-files/mysql.server /etc/init.d/mysql.server</code></strong>
</pre><p>
      A more detailed version of the source-build specific instructions
      is shown following.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The procedure shown here does not set up any passwords for MySQL
        accounts. After following the procedure, proceed to
        <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>, for postinstallation setup
        and testing.
</p>
</div>
<h4><a name="idm139899656920800"></a>Perform Preconfiguration Setup</h4>
<p>
      On Unix, set up the <code class="literal">mysql</code> user and group that
      will be used to run and execute the MySQL server and own the
      database directory. For details, see
      <a class="link" href="installing.html#binary-installation-createsysuser" title="Create a mysql User and Group">Creating a
      <code class="literal">mysql</code> System User and Group</a>, in
      <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>. Then perform the following
      steps as the <code class="literal">mysql</code> user, except as noted.
</p>
<h4><a name="idm139899656915680"></a>Obtain and Unpack the Distribution</h4>
<p>
      Pick the directory under which you want to unpack the distribution
      and change location into it.
    </p><p>
      Obtain a distribution file using the instructions in
      <a class="xref" href="installing.html#getting-mysql" title="2.1.2 How to Get MySQL">Section 2.1.2, “How to Get MySQL”</a>.
    </p><p>
      Unpack the distribution into the current directory:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          To unpack a compressed <span class="command"><strong>tar</strong></span> file,
          <span class="command"><strong>tar</strong></span> can uncompress and unpack the
          distribution if it has <code class="literal">z</code> option support:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>tar zxvf mysql-<em class="replaceable"><code>VERSION</code></em>.tar.gz</code></strong>
</pre><p>
          If your <span class="command"><strong>tar</strong></span> does not have
          <code class="literal">z</code> option support, use
          <span class="command"><strong>gunzip</strong></span> to unpack the distribution and
          <span class="command"><strong>tar</strong></span> to unpack it:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gunzip &lt; mysql-<em class="replaceable"><code>VERSION</code></em>.tar.gz | tar xvf -</code></strong>
</pre><p>
          Alternatively, <span class="command"><strong>CMake</strong></span> can uncompress and
          unpack the distribution:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake -E tar zxvf mysql-<em class="replaceable"><code>VERSION</code></em>.tar.gz</code></strong>
</pre></li><li class="listitem"><p>
          To unpack a Zip archive, use <span class="command"><strong>WinZip</strong></span> or
          another tool that can read <code class="filename">.zip</code> files.
</p></li></ul>
</div>
<p>
      Unpacking the distribution file creates a directory named
      <code class="filename">mysql-<em class="replaceable"><code>VERSION</code></em></code>.
</p>
<h4><a name="idm139899656894976"></a>Configure the Distribution</h4>
<p>
      Change location into the top-level directory of the unpacked
      distribution:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cd mysql-<em class="replaceable"><code>VERSION</code></em></code></strong>
</pre><p>
      Build outside of the source tree to keep the tree clean. If the
      top-level source directory is named <code class="filename">mysql-src</code>
      under your current working directory, you can build in a directory
      named <code class="filename">bld</code> at the same level. Create the
      directory and go there:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mkdir bld</code></strong>
shell&gt; <strong class="userinput"><code>cd bld</code></strong>
</pre><p>
      Configure the build directory. The minimum configuration command
      includes no options to override configuration defaults:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake ../mysql-src</code></strong>
</pre><p>
      The build directory needs not be outside the source tree.

      

      For example, you can build in a directory named
      <code class="filename">bld</code> under the top-level source tree. To do
      this, starting with <code class="filename">mysql-src</code> as your current
      working directory, create the directory <code class="filename">bld</code>
      and then go there:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mkdir bld</code></strong>
shell&gt; <strong class="userinput"><code>cd bld</code></strong>
</pre><p>
      Configure the build directory. The minimum configuration command
      includes no options to override configuration defaults:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake ..</code></strong>
</pre><p>
      If you have multiple source trees at the same level (for example,
      to build multiple versions of MySQL), the second strategy can be
      advantageous. The first strategy places all build directories at
      the same level, which requires that you choose a unique name for
      each. With the second strategy, you can use the same name for the
      build directory within each source tree. The following
      instructions assume this second strategy.
    </p><p>
      On Windows, specify the development environment. For example, the
      following commands configure MySQL for 32-bit or 64-bit builds,
      respectively:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake .. -G "Visual Studio 12 2013"</code></strong>
shell&gt; <strong class="userinput"><code>cmake .. -G "Visual Studio 12 2013 Win64"</code></strong>
</pre><p>
      On macOS, to use the Xcode IDE:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake .. -G Xcode</code></strong>
</pre><p>
      When you run <span class="command"><strong>cmake</strong></span>, you might want to add
      options to the command line. Here are some examples:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="installing.html#option_cmake_build_config"><code class="option">-DBUILD_CONFIG=mysql_release</code></a>:
          Configure the source with the same build options used by
          Oracle to produce binary distributions for official MySQL
          releases.
        </p></li><li class="listitem"><p>
          <a class="link" href="installing.html#option_cmake_cmake_install_prefix"><code class="option">-DCMAKE_INSTALL_PREFIX=<em class="replaceable"><code>dir_name</code></em></code></a>:
          Configure the distribution for installation under a particular
          location.
        </p></li><li class="listitem"><p>
          <a class="link" href="installing.html#option_cmake_cpack_monolithic_install"><code class="option">-DCPACK_MONOLITHIC_INSTALL=1</code></a>:
          Cause <span class="command"><strong>make package</strong></span> to generate a single
          installation file rather than multiple files.
        </p></li><li class="listitem"><p>
          <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">-DWITH_DEBUG=1</code></a>: Build the
          distribution with debugging support.
</p></li></ul>
</div>
<p>
      For a more extensive list of options, see
      <a class="xref" href="installing.html#source-configuration-options" title="2.9.4 MySQL Source-Configuration Options">Section 2.9.4, “MySQL Source-Configuration Options”</a>.
    </p><p>
      To list the configuration options, use one of the following
      commands:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake .. -L</code></strong>   # overview
shell&gt; <strong class="userinput"><code>cmake .. -LH</code></strong>  # overview with help text
shell&gt; <strong class="userinput"><code>cmake .. -LAH</code></strong> # all params with help text
shell&gt; <strong class="userinput"><code>ccmake ..</code></strong>     # interactive display
</pre><p>
      If <span class="command"><strong>CMake</strong></span> fails, you might need to reconfigure
      by running it again with different options. If you do reconfigure,
      take note of the following:
</p><a class="indexterm" name="idm139899656853776"></a><a class="indexterm" name="idm139899656852688"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If <span class="command"><strong>CMake</strong></span> is run after it has previously
          been run, it may use information that was gathered during its
          previous invocation. This information is stored in
          <code class="filename">CMakeCache.txt</code>. When
          <span class="command"><strong>CMake</strong></span> starts up, it looks for that file and
          reads its contents if it exists, on the assumption that the
          information is still correct. That assumption is invalid when
          you reconfigure.
        </p></li><li class="listitem"><p>
          Each time you run <span class="command"><strong>CMake</strong></span>, you must run
          <span class="command"><strong>make</strong></span> again to recompile. However, you may
          want to remove old object files from previous builds first
          because they were compiled using different configuration
          options.
</p></li></ul>
</div>
<p>
      To prevent old object files or configuration information from
      being used, run these commands in the build direcotry on Unix
      before re-running <span class="command"><strong>CMake</strong></span>:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>make clean</code></strong>
shell&gt; <strong class="userinput"><code>rm CMakeCache.txt</code></strong>
</pre><p>
      Or, on Windows:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>devenv MySQL.sln /clean</code></strong>
shell&gt; <strong class="userinput"><code>del CMakeCache.txt</code></strong>
</pre><p>
      If you are going to send mail to a MySQL mailing list to ask for
      configuration assistance, first check the files in the
      <code class="filename">CMakeFiles</code> directory for useful information
      about the failure. To file a bug report, please use the
      instructions in <a class="xref" href="introduction.html#bug-reports" title="1.7 How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>.
</p>
<h4><a name="idm139899656836528"></a>Build the Distribution</h4>
<p>
      On Unix:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>make</code></strong>
shell&gt; <strong class="userinput"><code>make VERBOSE=1</code></strong>
</pre><p>
      The second command sets <code class="literal">VERBOSE</code> to show the
      commands for each compiled source.
    </p><p>
      Use <span class="command"><strong>gmake</strong></span> instead on systems where you are
      using GNU <span class="command"><strong>make</strong></span> and it has been installed as
      <span class="command"><strong>gmake</strong></span>.
    </p><p>
      On Windows:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>devenv MySQL.sln /build RelWithDebInfo</code></strong>
</pre><p>
      If you have gotten to the compilation stage, but the distribution
      does not build, see <a class="xref" href="installing.html#compilation-problems" title="2.9.5 Dealing with Problems Compiling MySQL">Section 2.9.5, “Dealing with Problems Compiling MySQL”</a>, for
      help. If that does not solve the problem, please enter it into our
      bugs database using the instructions given in
      <a class="xref" href="introduction.html#bug-reports" title="1.7 How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>. If you have installed the latest
      versions of the required tools, and they crash trying to process
      our configuration files, please report that also. However, if you
      get a <code class="literal">command not found</code> error or a similar
      problem for required tools, do not report it. Instead, make sure
      that all the required tools are installed and that your
      <code class="literal">PATH</code> variable is set correctly so that your
      shell can find them.
</p>
<h4><a name="idm139899656823200"></a>Install the Distribution</h4>
<p>
      On Unix:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>make install</code></strong>
</pre><p>
      This installs the files under the configured installation
      directory (by default, <code class="filename">/usr/local/mysql</code>). You
      might need to run the command as <code class="literal">root</code>.
    </p><p>
      To install in a specific directory, add a
      <code class="literal">DESTDIR</code> parameter to the command line:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>make install DESTDIR="/opt/mysql"</code></strong>
</pre><p>
      Alternatively, generate installation package files that you can
      install where you like:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>make package</code></strong>
</pre><p>
      This operation produces one or more <code class="filename">.tar.gz</code>
      files that can be installed like generic binary distribution
      packages. See <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>. If you run
      <span class="command"><strong>CMake</strong></span> with
      <a class="link" href="installing.html#option_cmake_cpack_monolithic_install"><code class="option">-DCPACK_MONOLITHIC_INSTALL=1</code></a>, the
      operation produces a single file. Otherwise, it produces multiple
      files.
    </p><p>
      On Windows, generate the data directory, then create a
      <code class="filename">.zip</code> archive installation package:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>devenv MySQL.sln /build RelWithDebInfo /project initial_database</code></strong>
shell&gt; <strong class="userinput"><code>devenv MySQL.sln /build RelWithDebInfo /project package</code></strong>
</pre><p>
      You can install the resulting <code class="filename">.zip</code> archive
      where you like. See <a class="xref" href="installing.html#windows-install-archive" title="2.3.5 Installing MySQL on Microsoft Windows Using a noinstall ZIP Archive">Section 2.3.5, “Installing MySQL on Microsoft Windows Using a
      <code class="literal">noinstall</code> ZIP Archive”</a>.
</p>
<h4><a name="idm139899656804224"></a>Perform Postinstallation Setup</h4>
<p>
      The remainder of the installation process involves setting up the
      configuration file, creating the core databases, and starting the
      MySQL server. For instructions, see
      <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The accounts that are listed in the MySQL grant tables initially
        have no passwords. After starting the server, you should set up
        passwords for them using the instructions in
        <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="installing-development-tree"></a>2.9.3 Installing MySQL Using a Development Source Tree</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899656799232"></a><a class="indexterm" name="idm139899656798160"></a><p>
      This section describes how to install MySQL from the latest
      development source code, which is hosted on
      <a class="ulink" href="https://github.com/" target="_top">GitHub</a>. To obtain the
      MySQL Server source code from this repository hosting service, you
      can set up a local MySQL Git repository.
    </p><p>
      On <a class="ulink" href="https://github.com/" target="_top">GitHub</a>, MySQL Server
      and other MySQL projects are found on the
      <a class="ulink" href="https://github.com/mysql" target="_top">MySQL</a> page. The
      MySQL Server project is a single repository that contains branches
      for several MySQL series.
    </p><p>
      MySQL officially joined GitHub in September, 2014. For more
      information about MySQL's move to GitHub, refer to the
      announcement on the MySQL Release Engineering blog:
      <a class="ulink" href="http://mysqlrelease.com/2014/09/mysql-on-github/" target="_top">MySQL
      on GitHub</a>
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="installing-development-tree-prerequisites"></a>Prerequisites for Installing from Development Source</h4>
</div>
</div>
</div>
<p>
        To install MySQL from a development source tree, your system
        must satisfy the tool requirements outlined in
        <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="installing-development-tree-git"></a>Setting Up a MySQL Git Repository</h4>

</div>

</div>

</div>
<p>
        To set up a MySQL Git repository on your machine, use this
        procedure:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Clone the MySQL Git repository to your machine. The
            following command clones the MySQL Git repository to a
            directory named <code class="filename">mysql-server</code>. The
            initial download will take some time to complete, depending
            on the speed of your connection.
          </p><pre data-lang="terminal" class="programlisting">~$ git clone https://github.com/mysql/mysql-server.git
Cloning into 'mysql-server'...
remote: Counting objects: 1198513, done.
remote: Total 1198513 (delta 0), reused 0 (delta 0), pack-reused 1198513
Receiving objects: 100% (1198513/1198513), 1.01 GiB | 7.44 MiB/s, done.
Resolving deltas: 100% (993200/993200), done.
Checking connectivity... done.
Checking out files: 100% (25510/25510), done.</pre></li><li class="listitem"><p>
            When the clone operation completes, the contents of your
            local MySQL Git repository appear similar to the following:
          </p><pre data-lang="terminal" class="programlisting">~$ cd mysql-server
~/mysql-server$ ls
BUILD                cmd-line-utils       libservices          sql
CMakeLists.txt       config.h.cmake       man                  sql-common
COPYING              configure.cmake      mysql-test           storage
Docs                 dbug                 mysys                strings
Doxyfile-perfschema  extra                mysys_ssl            support-files
INSTALL              include              packaging            testclients
README               libbinlogevents      plugin               unittest
VERSION              libbinlogstandalone  rapid                vio
client               libevent             regex                win
cmake                libmysql             scripts              zlib
</pre></li><li class="listitem"><p>
            Use the <span class="command"><strong>git branch -r</strong></span> command to view the
            remote tracking branches for the MySQL repository.
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git branch -r
  origin/5.5
  origin/5.6
  origin/5.7
  origin/8.0
  origin/HEAD -&gt; origin/5.7
  origin/cluster-7.2
  origin/cluster-7.3
  origin/cluster-7.4
  origin/cluster-7.5</pre></li><li class="listitem"><p>
            To view the branches that are checked out in your local
            repository, issue the <span class="command"><strong>git branch</strong></span> command.
            When you cloned the MySQL Git repository, the MySQL 5.7
            branch was checked out automatically. The asterisk
            identifies the 5.7 branch as the active branch.
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git branch
* 5.7</pre></li><li class="listitem"><p>
            To check out a different MySQL branch, run the <span class="command"><strong>git
            checkout</strong></span> command, specifying the branch name. For
            example, to check out the MySQL 8.0 branch:
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git checkout 8.0
Checking out files: 100% (9600/9600), done.
Branch 8.0 set up to track remote branch 8.0 from origin.
Switched to a new branch '8.0'</pre></li><li class="listitem"><p>
            Run <code class="literal">git branch</code> to verify that the MySQL
            8.0 branch is present. MySQL 8.0, which is the last branch
            you checked out, is marked by an asterisk indicating that it
            is the active branch.
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git branch
  5.7
* 8.0</pre></li><li class="listitem"><p>
            Use the <span class="command"><strong>git checkout</strong></span> command to switch
            between branches. For example:
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git checkout 5.7</pre></li><li class="listitem"><p>
            To obtain changes made after your initial setup of the MySQL
            Git repository, switch to the branch you want to update and
            issue the <code class="literal">git pull</code> command:
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git checkout 8.0
~/mysql-server$ git pull
</pre><p>
            To examine the commit history, use the <code class="literal">git
            log</code> option:
          </p><pre data-lang="terminal" class="programlisting">~/mysql-server$ git log
</pre><p>
            You can also browse commit history and source code on the
            GitHub <a class="ulink" href="https://github.com/mysql" target="_top">MySQL</a>
            site.
          </p><p>
            If you see changes or code that you have a question about,
            send an email to the MySQL <code class="literal">internals</code>
            mailing list. See <a class="xref" href="introduction.html#mailing-lists" title="1.6.2 MySQL Mailing Lists">Section 1.6.2, “MySQL Mailing Lists”</a>. For
            information about contributing a patch, see
            <a class="ulink" href="http://mysqlserverteam.com/contributing-to-mysql-server/%20" target="_top">Contributing
            to MySQL Server</a>.
          </p></li><li class="listitem"><p>
            After you have cloned the MySQL Git repository and have
            checked out the branch you want to build, you can build
            MySQL Server from the source code. Instructions are provided
            in <a class="xref" href="installing.html#installing-source-distribution" title="2.9.2 Installing MySQL Using a Standard Source Distribution">Section 2.9.2, “Installing MySQL Using a Standard Source Distribution”</a>, except
            that you skip the part about obtaining and unpacking the
            distribution.
          </p><p>
            Be careful about installing a build from a distribution
            source tree on a production machine. The installation
            command may overwrite your live release installation. If you
            already have MySQL installed and do not want to overwrite
            it, run <span class="command"><strong>CMake</strong></span> with values for the
            <a class="link" href="installing.html#option_cmake_cmake_install_prefix"><code class="option">CMAKE_INSTALL_PREFIX</code></a>,
            <a class="link" href="installing.html#option_cmake_mysql_tcp_port"><code class="option">MYSQL_TCP_PORT</code></a>, and
            <a class="link" href="installing.html#option_cmake_mysql_unix_addr"><code class="option">MYSQL_UNIX_ADDR</code></a> options
            different from those used by your production server. For
            additional information about preventing multiple servers
            from interfering with each other, see
            <a class="xref" href="server-administration.html#multiple-servers" title="5.7 Running Multiple MySQL Instances on One Machine">Section 5.7, “Running Multiple MySQL Instances on One Machine”</a>.
          </p><p>
            Play hard with your new installation. For example, try to
            make new features crash. Start by running <span class="command"><strong>make
            test</strong></span>. See <a class="xref" href="extending-mysql.html#mysql-test-suite" title="28.1.2 The MySQL Test Suite">Section 28.1.2, “The MySQL Test Suite”</a>.
</p></li></ol>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="source-configuration-options"></a>2.9.4 MySQL Source-Configuration Options</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899656748256"></a><a class="indexterm" name="idm139899656746768"></a><a class="indexterm" name="idm139899656745280"></a><p>
      The <span class="command"><strong>CMake</strong></span> program provides a great deal of
      control over how you configure a MySQL source distribution.
      Typically, you do this using options on the
      <span class="command"><strong>CMake</strong></span> command line. For information about
      options supported by <span class="command"><strong>CMake</strong></span>, run either of these
      commands in the top-level source directory:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake . -LH</code></strong>
shell&gt; <strong class="userinput"><code>ccmake .</code></strong>
</pre><p>
      You can also affect <span class="command"><strong>CMake</strong></span> using certain
      environment variables. See
      <a class="xref" href="programs.html#environment-variables" title="4.9 MySQL Program Environment Variables">Section 4.9, “MySQL Program Environment Variables”</a>.
    </p><p>
      The following table shows the available <span class="command"><strong>CMake</strong></span>
      options. In the <code class="literal">Default</code> column,
      <code class="literal">PREFIX</code> stands for the value of the
      <a class="link" href="installing.html#option_cmake_cmake_install_prefix"><code class="option">CMAKE_INSTALL_PREFIX</code></a> option, which
      specifies the installation base directory. This value is used as
      the parent location for several of the installation
      subdirectories.
</p>
<div class="table">
<a name="idm139899656733328"></a><p class="title"><b>Table 2.13 MySQL Source-Configuration Option Reference
(CMake)</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="CMake options that are available to configure MySQL when building from source."><col width="30%"><col width="30%"><col width="20%"><col width="10%"><col width="10%"><thead><tr><th scope="col">Formats</th>
<th scope="col">Description</th>
<th scope="col">Default</th>
<th scope="col">Introduced</th>
<th scope="col">Removed</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="installing.html#option_cmake_build_config"><code class="literal">BUILD_CONFIG</code></a></td>
<td>Use same build options as official releases</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_bundle_runtime_libraries"><code class="literal">BUNDLE_RUNTIME_LIBRARIES</code></a></td>
<td>Bundle runtime libraries with server MSI and Zip packages for Windows</td>
<td><code class="literal">OFF</code></td>
<td>8.0.11</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_cmake_build_type"><code class="literal">CMAKE_BUILD_TYPE</code></a></td>
<td>Type of build to produce</td>
<td><code class="literal">RelWithDebInfo</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_cmake_cxx_flags"><code class="literal">CMAKE_CXX_FLAGS</code></a></td>
<td>Flags for C++ Compiler</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_cmake_c_flags"><code class="literal">CMAKE_C_FLAGS</code></a></td>
<td>Flags for C Compiler</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_cmake_install_prefix"><code class="literal">CMAKE_INSTALL_PREFIX</code></a></td>
<td>Installation base directory</td>
<td><code class="literal">/usr/local/mysql</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_compilation_comment"><code class="literal">COMPILATION_COMMENT</code></a></td>
<td>Comment about compilation environment</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_cpack_monolithic_install"><code class="literal">CPACK_MONOLITHIC_INSTALL</code></a></td>
<td>Whether package build produces single file</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_default_charset"><code class="literal">DEFAULT_CHARSET</code></a></td>
<td>The default server character set</td>
<td><code class="literal">utf8mb4</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_default_collation"><code class="literal">DEFAULT_COLLATION</code></a></td>
<td>The default server collation</td>
<td><code class="literal">utf8mb4_0900_ai_ci</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><code class="literal">DISABLE_DATA_LOCK</code></td>
<td>Exclude the performance schema data lock instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_cond"><code class="literal">DISABLE_PSI_COND</code></a></td>
<td>Exclude Performance Schema condition instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_error"><code class="literal">DISABLE_PSI_ERROR</code></a></td>
<td>Exclude the performance schema server error instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_file"><code class="literal">DISABLE_PSI_FILE</code></a></td>
<td>Exclude Performance Schema file instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_idle"><code class="literal">DISABLE_PSI_IDLE</code></a></td>
<td>Exclude Performance Schema idle instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_memory"><code class="literal">DISABLE_PSI_MEMORY</code></a></td>
<td>Exclude Performance Schema memory instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_metadata"><code class="literal">DISABLE_PSI_METADATA</code></a></td>
<td>Exclude Performance Schema metadata instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_mutex"><code class="literal">DISABLE_PSI_MUTEX</code></a></td>
<td>Exclude Performance Schema mutex instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_ps"><code class="literal">DISABLE_PSI_PS</code></a></td>
<td>Exclude the performance schema prepared statements</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_rwlock"><code class="literal">DISABLE_PSI_RWLOCK</code></a></td>
<td>Exclude Performance Schema rwlock instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_socket"><code class="literal">DISABLE_PSI_SOCKET</code></a></td>
<td>Exclude Performance Schema socket instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_sp"><code class="literal">DISABLE_PSI_SP</code></a></td>
<td>Exclude Performance Schema stored program instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_stage"><code class="literal">DISABLE_PSI_STAGE</code></a></td>
<td>Exclude Performance Schema stage instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_statement"><code class="literal">DISABLE_PSI_STATEMENT</code></a></td>
<td>Exclude Performance Schema statement instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_statement_digest"><code class="literal">DISABLE_PSI_STATEMENT_DIGEST</code></a></td>
<td>Exclude Performance Schema statements_digest instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_table"><code class="literal">DISABLE_PSI_TABLE</code></a></td>
<td>Exclude Performance Schema table instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_thread"><code class="literal">DISABLE_PSI_THREAD</code></a></td>
<td>Exclude the performance schema thread instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_psi_transaction"><code class="literal">DISABLE_PSI_TRANSACTION</code></a></td>
<td>Exclude the performance schema transaction instrumentation</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_disable_shared"><code class="literal">DISABLE_SHARED</code></a></td>
<td>Do not build shared libraries, compile position-dependent code</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_download_boost"><code class="literal">DOWNLOAD_BOOST</code></a></td>
<td>Whether to download the Boost library</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_download_boost_timeout"><code class="literal">DOWNLOAD_BOOST_TIMEOUT</code></a></td>
<td>Timeout in seconds for downloading the Boost library</td>
<td><code class="literal">600</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enabled_local_infile"><code class="literal">ENABLED_LOCAL_INFILE</code></a></td>
<td>Whether to enable LOCAL for LOAD DATA INFILE</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enabled_profiling"><code class="literal">ENABLED_PROFILING</code></a></td>
<td>Whether to enable query profiling code</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enable_debug_sync"><code class="literal">ENABLE_DEBUG_SYNC</code></a></td>
<td>Whether to enable Debug Sync support</td>
<td><code class="literal">ON</code></td>
<td></td>
<td>8.0.1</td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enable_downloads"><code class="literal">ENABLE_DOWNLOADS</code></a></td>
<td>Whether to download optional files</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enable_dtrace"><code class="literal">ENABLE_DTRACE</code></a></td>
<td>Whether to include DTrace support</td>
<td></td>
<td></td>
<td>8.0.1</td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enable_experimental_sysvars"><code class="literal">ENABLE_EXPERIMENTAL_SYSVARS</code></a></td>
<td>Whether to enabled experimental InnoDB system variables</td>
<td><code class="literal">OFF</code></td>
<td>8.0.11</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enable_gcov"><code class="literal">ENABLE_GCOV</code></a></td>
<td>Whether to include gcov support</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_enable_gprof"><code class="literal">ENABLE_GPROF</code></a></td>
<td>Enable gprof (optimized Linux builds only)</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_force_unsupported_compiler"><code class="literal">FORCE_UNSUPPORTED_COMPILER</code></a></td>
<td>Whether to permit unsupported compiler</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_ignore_aio_check"><code class="literal">IGNORE_AIO_CHECK</code></a></td>
<td>With -DBUILD_CONFIG=mysql_release, ignore libaio check</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_bindir"><code class="literal">INSTALL_BINDIR</code></a></td>
<td>User executables directory</td>
<td><code class="literal">PREFIX/bin</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_docdir"><code class="literal">INSTALL_DOCDIR</code></a></td>
<td>Documentation directory</td>
<td><code class="literal">PREFIX/docs</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_docreadmedir"><code class="literal">INSTALL_DOCREADMEDIR</code></a></td>
<td>README file directory</td>
<td><code class="literal">PREFIX</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_includedir"><code class="literal">INSTALL_INCLUDEDIR</code></a></td>
<td>Header file directory</td>
<td><code class="literal">PREFIX/include</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_infodir"><code class="literal">INSTALL_INFODIR</code></a></td>
<td>Info file directory</td>
<td><code class="literal">PREFIX/docs</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_layout"><code class="literal">INSTALL_LAYOUT</code></a></td>
<td>Select predefined installation layout</td>
<td><code class="literal">STANDALONE</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_libdir"><code class="literal">INSTALL_LIBDIR</code></a></td>
<td>Library file directory</td>
<td><code class="literal">PREFIX/lib</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_mandir"><code class="literal">INSTALL_MANDIR</code></a></td>
<td>Manual page directory</td>
<td><code class="literal">PREFIX/man</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_mysqlkeyringdir"><code class="literal">INSTALL_MYSQLKEYRINGDIR</code></a></td>
<td>Directory for keyring_file plugin data file</td>
<td><code class="literal">platform specific</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_mysqlsharedir"><code class="literal">INSTALL_MYSQLSHAREDIR</code></a></td>
<td>Shared data directory</td>
<td><code class="literal">PREFIX/share</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_mysqltestdir"><code class="literal">INSTALL_MYSQLTESTDIR</code></a></td>
<td>mysql-test directory</td>
<td><code class="literal">PREFIX/mysql-test</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_pkgconfigdir"><code class="literal">INSTALL_PKGCONFIGDIR</code></a></td>
<td>Directory for mysqlclient.pc pkg-config file</td>
<td><code class="literal">INSTALL_LIBDIR/pkgconfig</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_plugindir"><code class="literal">INSTALL_PLUGINDIR</code></a></td>
<td>Plugin directory</td>
<td><code class="literal">PREFIX/lib/plugin</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_sbindir"><code class="literal">INSTALL_SBINDIR</code></a></td>
<td>Server executable directory</td>
<td><code class="literal">PREFIX/bin</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_secure_file_privdir"><code class="literal">INSTALL_SECURE_FILE_PRIVDIR</code></a></td>
<td>secure_file_priv default value</td>
<td><code class="literal">platform specific</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_sharedir"><code class="literal">INSTALL_SHAREDIR</code></a></td>
<td>aclocal/mysql.m4 installation directory</td>
<td><code class="literal">PREFIX/share</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_static_libraries"><code class="literal">INSTALL_STATIC_LIBRARIES</code></a></td>
<td>Whether to install static libraries</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_install_supportfilesdir"><code class="literal">INSTALL_SUPPORTFILESDIR</code></a></td>
<td>Extra support files directory</td>
<td><code class="literal">PREFIX/support-files</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_link_randomize"><code class="literal">LINK_RANDOMIZE</code></a></td>
<td>Whether to randomize order of symbols in mysqld binary</td>
<td><code class="literal">OFF</code></td>
<td>8.0.1</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_link_randomize_seed"><code class="literal">LINK_RANDOMIZE_SEED</code></a></td>
<td>Seed value for LINK_RANDOMIZE option</td>
<td><code class="literal">mysql</code></td>
<td>8.0.1</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_max_indexes"><code class="literal">MAX_INDEXES</code></a></td>
<td>Maximum indexes per table</td>
<td><code class="literal">64</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mutex_type"><code class="literal">MUTEX_TYPE</code></a></td>
<td>InnoDB mutex type</td>
<td><code class="literal">event</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysqlx_tcp_port"><code class="literal">MYSQLX_TCP_PORT</code></a></td>
<td>TCP/IP port number used by X Plugin</td>
<td><code class="literal">33060</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysqlx_unix_addr"><code class="literal">MYSQLX_UNIX_ADDR</code></a></td>
<td>Unix socket file used by X Plugin</td>
<td><code class="literal">/tmp/mysqlx.sock</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysql_datadir"><code class="literal">MYSQL_DATADIR</code></a></td>
<td>Data directory</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysql_maintainer_mode"><code class="literal">MYSQL_MAINTAINER_MODE</code></a></td>
<td>Whether to enable MySQL maintainer-specific development environment</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysql_project_name"><code class="literal">MYSQL_PROJECT_NAME</code></a></td>
<td>Windows/OS X project name</td>
<td><code class="literal">MySQL</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysql_tcp_port"><code class="literal">MYSQL_TCP_PORT</code></a></td>
<td>TCP/IP port number</td>
<td><code class="literal">3306</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_mysql_unix_addr"><code class="literal">MYSQL_UNIX_ADDR</code></a></td>
<td>Unix socket file</td>
<td><code class="literal">/tmp/mysql.sock</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_odbc_includes"><code class="literal">ODBC_INCLUDES</code></a></td>
<td>ODBC includes directory</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_odbc_lib_dir"><code class="literal">ODBC_LIB_DIR</code></a></td>
<td>ODBC library directory</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_optimizer_trace"><code class="literal">OPTIMIZER_TRACE</code></a></td>
<td>Whether to support optimizer tracing</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_reproducible_build"><code class="literal">REPRODUCIBLE_BUILD</code></a></td>
<td>Take extra care to create a build result independent of build location and time</td>
<td></td>
<td>8.0.11</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_sysconfdir"><code class="literal">SYSCONFDIR</code></a></td>
<td>Option file directory</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_systemd_pid_dir"><code class="literal">SYSTEMD_PID_DIR</code></a></td>
<td>Directory for PID file under systemd</td>
<td><code class="literal">/var/run/mysqld</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_systemd_service_name"><code class="literal">SYSTEMD_SERVICE_NAME</code></a></td>
<td>Name of MySQL service under systemd</td>
<td><code class="literal">mysqld</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_tmpdir"><code class="literal">TMPDIR</code></a></td>
<td>tmpdir default value</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_use_ld_gold"><code class="literal">USE_LD_GOLD</code></a></td>
<td>Whether to use GNU gold loader</td>
<td><code class="literal">ON</code></td>
<td>8.0.0</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_win_debug_no_inline"><code class="literal">WIN_DEBUG_NO_INLINE</code></a></td>
<td>Whether to disable function inlining</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_without_server"><code class="literal">WITHOUT_SERVER</code></a></td>
<td>Do not build the server</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_storage_engine_options" title="Storage Engine Options"><code class="literal">WITHOUT_xxx_STORAGE_ENGINE</code></a></td>
<td>Exclude storage engine xxx from build</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_ant"><code class="literal">WITH_ANT</code></a></td>
<td>Path to Ant for building GCS Java wrapper</td>
<td></td>
<td>8.0.11</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_asan"><code class="literal">WITH_ASAN</code></a></td>
<td>Enable AddressSanitizer</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_asan_scope"><code class="literal">WITH_ASAN_SCOPE</code></a></td>
<td>Enable AddressSanitizer -fsanitize-address-use-after-scope Clang flag</td>
<td><code class="literal">OFF</code></td>
<td>8.0.4</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_authentication_ldap"><code class="literal">WITH_AUTHENTICATION_LDAP</code></a></td>
<td>Whether to report error if LDAP authentication plugins cannot be built</td>
<td><code class="literal">OFF</code></td>
<td>8.0.2</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_authentication_pam"><code class="literal">WITH_AUTHENTICATION_PAM</code></a></td>
<td>Build PAM authentication plugin</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_aws_sdk"><code class="literal">WITH_AWS_SDK</code></a></td>
<td>Location of Amazon Web Services software development kit</td>
<td></td>
<td>8.0.2</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_boost"><code class="literal">WITH_BOOST</code></a></td>
<td>The location of the Boost library sources</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_client_protocol_tracing"><code class="literal">WITH_CLIENT_PROTOCOL_TRACING</code></a></td>
<td>Build client-side protocol tracing framework</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_curl"><code class="literal">WITH_CURL</code></a></td>
<td>Location of curl library</td>
<td></td>
<td>8.0.2</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_debug"><code class="literal">WITH_DEBUG</code></a></td>
<td>Whether to include debugging support</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_default_compiler_options"><code class="literal">WITH_DEFAULT_COMPILER_OPTIONS</code></a></td>
<td>Whether to use default compiler options</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_default_feature_set"><code class="literal">WITH_DEFAULT_FEATURE_SET</code></a></td>
<td>Whether to use default feature set</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_editline"><code class="literal">WITH_EDITLINE</code></a></td>
<td>Which libedit/editline library to use</td>
<td><code class="literal">bundled</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_icu"><code class="literal">WITH_ICU</code></a></td>
<td>Type of ICU support</td>
<td><code class="literal">bundled</code></td>
<td>8.0.4</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_innodb_extra_debug"><code class="literal">WITH_INNODB_EXTRA_DEBUG</code></a></td>
<td>Whether to include extra debugging support for InnoDB.</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_innodb_memcached"><code class="literal">WITH_INNODB_MEMCACHED</code></a></td>
<td>Whether to generate memcached shared libraries.</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_keyring_test"><code class="literal">WITH_KEYRING_TEST</code></a></td>
<td>Build the keyring test program</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_libevent"><code class="literal">WITH_LIBEVENT</code></a></td>
<td>Which libevent library to use</td>
<td><code class="literal">bundled</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_libwrap"><code class="literal">WITH_LIBWRAP</code></a></td>
<td>Whether to include libwrap (TCP wrappers) support</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_lz4"><code class="literal">WITH_LZ4</code></a></td>
<td>Type of LZ4 library support</td>
<td><code class="literal">bundled</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_lzma"><code class="literal">WITH_LZMA</code></a></td>
<td>Type of LZMA library support</td>
<td><code class="literal">bundled</code></td>
<td>8.0.4</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_mecab"><code class="literal">WITH_MECAB</code></a></td>
<td>Compiles MeCab</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_msan"><code class="literal">WITH_MSAN</code></a></td>
<td>Enable MemorySanitizer</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_mscrt_debug"><code class="literal">WITH_MSCRT_DEBUG</code></a></td>
<td>Enable Visual Studio CRT memory leak tracing</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_numa"><code class="literal">WITH_NUMA</code></a></td>
<td>Set NUMA memory allocation policy</td>
<td></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_protobuf"><code class="literal">WITH_PROTOBUF</code></a></td>
<td>Which Protocol Buffers package to use</td>
<td><code class="literal">bundled</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_rapid"><code class="literal">WITH_RAPID</code></a></td>
<td>Whether to build rapid development cycle plugins</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_re2"><code class="literal">WITH_RE2</code></a></td>
<td>Type of RE2 library support</td>
<td><code class="literal">bundled</code></td>
<td>8.0.4</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_ssl"><code class="literal">WITH_SSL</code></a></td>
<td>Type of SSL support</td>
<td><code class="literal">system</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_systemd"><code class="literal">WITH_SYSTEMD</code></a></td>
<td>Enable installation of systemd support files</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_system_libs"><code class="literal">WITH_SYSTEM_LIBS</code></a></td>
<td>Set system value of library options not set explicitly</td>
<td><code class="literal">OFF</code></td>
<td>8.0.11</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_test_trace_plugin"><code class="literal">WITH_TEST_TRACE_PLUGIN</code></a></td>
<td>Build test protocol trace plugin</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_tsan"><code class="literal">WITH_TSAN</code></a></td>
<td>Enable ThreadSanitizer</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_ubsan"><code class="literal">WITH_UBSAN</code></a></td>
<td>Enable Undefined Behavior Sanitizer</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_unit_tests"><code class="literal">WITH_UNIT_TESTS</code></a></td>
<td>Compile MySQL with unit tests</td>
<td><code class="literal">ON</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_unixodbc"><code class="literal">WITH_UNIXODBC</code></a></td>
<td>Enable unixODBC support</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_valgrind"><code class="literal">WITH_VALGRIND</code></a></td>
<td>Whether to compile in Valgrind header files</td>
<td><code class="literal">OFF</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_with_zlib"><code class="literal">WITH_ZLIB</code></a></td>
<td>Type of zlib support</td>
<td><code class="literal">bundled</code></td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="installing.html#option_cmake_storage_engine_options" title="Storage Engine Options"><code class="literal">WITH_xxx_STORAGE_ENGINE</code></a></td>
<td>Compile storage engine xxx statically into server</td>
<td></td>
<td></td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      The following sections provide more information about
      <span class="command"><strong>CMake</strong></span> options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="xref" href="installing.html#cmake-general-options" title="General Options">General Options</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#cmake-installation-layout-options" title="Installation Layout Options">Installation Layout Options</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#option_cmake_storage_engine_options" title="Storage Engine Options">Storage Engine Options</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#cmake-feature-options" title="Feature Options">Feature Options</a>
        </p></li><li class="listitem"><p>
          <a class="xref" href="installing.html#cmake-compiler-flags" title="Compiler Flags">Compiler Flags</a>
</p></li></ul>
</div>
<p>
      For boolean options, the value may be specified as 1 or
      <code class="literal">ON</code> to enable the option, or as 0 or
      <code class="literal">OFF</code> to disable the option.
    </p><p>
      Many options configure compile-time defaults that can be
      overridden at server startup. For example, the
      <a class="link" href="installing.html#option_cmake_cmake_install_prefix"><code class="option">CMAKE_INSTALL_PREFIX</code></a>,
      <a class="link" href="installing.html#option_cmake_mysql_tcp_port"><code class="option">MYSQL_TCP_PORT</code></a>, and
      <a class="link" href="installing.html#option_cmake_mysql_unix_addr"><code class="option">MYSQL_UNIX_ADDR</code></a> options that
      configure the default installation base directory location, TCP/IP
      port number, and Unix socket file can be changed at server startup
      with the <a class="link" href="server-administration.html#option_mysqld_basedir"><code class="option">--basedir</code></a>,
      <a class="link" href="server-administration.html#option_mysqld_port"><code class="option">--port</code></a>, and
      <a class="link" href="server-administration.html#option_mysqld_socket"><code class="option">--socket</code></a> options for
      <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. Where applicable, configuration option
      descriptions indicate the corresponding <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
      startup option.
</p>
<h4><a name="cmake-general-options"></a>General Options</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_cmake_build_config"></a>
          <a class="indexterm" name="idm139899655880096"></a>

          <a class="indexterm" name="idm139899655878608"></a>

          <code class="literal">-DBUILD_CONFIG=mysql_release</code>
        </p><p>
          This option configures a source distribution with the same
          build options used by Oracle to produce binary distributions
          for official MySQL releases.
        </p></li><li class="listitem"><p><a name="option_cmake_bundle_runtime_libraries"></a>
          <code class="literal">-DBUNDLE_RUNTIME_LIBRARIES=<em class="replaceable"><code>bool</code></em></code>
        </p><a class="indexterm" name="idm139899655873648"></a><a class="indexterm" name="idm139899655872144"></a><p>
          Whether to bundle runtime libraries with server MSI and Zip
          packages for Windows.
        </p></li><li class="listitem"><p><a name="option_cmake_cmake_build_type"></a>
          <a class="indexterm" name="idm139899655869104"></a>

          <a class="indexterm" name="idm139899655867616"></a>

          <code class="literal">-DCMAKE_BUILD_TYPE=<em class="replaceable"><code>type</code></em></code>
        </p><p>
          The type of build to produce:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">RelWithDebInfo</code>: Enable optimizations
              and generate debugging information. This is the default
              MySQL build type.
            </p></li><li class="listitem"><p>
              <code class="literal">Debug</code>: Disable optimizations and
              generate debugging information. This build type is also
              used if the <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>
              option is enabled. That is,
              <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">-DWITH_DEBUG=1</code></a> has the same
              effect as
              <a class="link" href="installing.html#option_cmake_cmake_build_type"><code class="option">-DCMAKE_BUILD_TYPE=Debug</code></a>.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_cpack_monolithic_install"></a>
          <a class="indexterm" name="idm139899655857120"></a>

          <a class="indexterm" name="idm139899655855696"></a>

          <code class="literal">-DCPACK_MONOLITHIC_INSTALL=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          This option affects whether the <span class="command"><strong>make
          package</strong></span> operation produces multiple installation
          package files or a single file. If disabled, the operation
          produces multiple installation package files, which may be
          useful if you want to install only a subset of a full MySQL
          installation. If enabled, it produces a single file for
          installing everything.
</p></li></ul>
</div>
<h4><a name="cmake-installation-layout-options"></a>Installation Layout Options</h4>
<p>
      The <a class="link" href="installing.html#option_cmake_cmake_install_prefix"><code class="option">CMAKE_INSTALL_PREFIX</code></a> option
      indicates the base installation directory. Other options with
      names of the form
      <code class="literal">INSTALL_<em class="replaceable"><code>xxx</code></em></code> that
      indicate component locations are interpreted relative to the
      prefix and their values are relative pathnames. Their values
      should not include the prefix.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_cmake_cmake_install_prefix"></a>
          <a class="indexterm" name="idm139899655847456"></a>

          <a class="indexterm" name="idm139899655846064"></a>

          <code class="literal">-DCMAKE_INSTALL_PREFIX=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The installation base directory.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#option_mysqld_basedir"><code class="option">--basedir</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_install_bindir"></a>
          <a class="indexterm" name="idm139899655841184"></a>

          <a class="indexterm" name="idm139899655839792"></a>

          <code class="literal">-DINSTALL_BINDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install user programs.
        </p></li><li class="listitem"><p><a name="option_cmake_install_docdir"></a>
          <a class="indexterm" name="idm139899655836128"></a>

          <a class="indexterm" name="idm139899655834736"></a>

          <code class="literal">-DINSTALL_DOCDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install documentation.
        </p></li><li class="listitem"><p><a name="option_cmake_install_docreadmedir"></a>
          <a class="indexterm" name="idm139899655831072"></a>

          <a class="indexterm" name="idm139899655829680"></a>

          <code class="literal">-DINSTALL_DOCREADMEDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install <code class="filename">README</code> files.
        </p></li><li class="listitem"><p><a name="option_cmake_install_includedir"></a>
          <a class="indexterm" name="idm139899655825392"></a>

          <a class="indexterm" name="idm139899655824000"></a>

          <code class="literal">-DINSTALL_INCLUDEDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install header files.
        </p></li><li class="listitem"><p><a name="option_cmake_install_infodir"></a>
          <a class="indexterm" name="idm139899655820336"></a>

          <a class="indexterm" name="idm139899655818944"></a>

          <code class="literal">-DINSTALL_INFODIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install Info files.
        </p></li><li class="listitem"><p><a name="option_cmake_install_layout"></a>
          <a class="indexterm" name="idm139899655815280"></a>

          <a class="indexterm" name="idm139899655813888"></a>

          <code class="literal">-DINSTALL_LAYOUT=<em class="replaceable"><code>name</code></em></code>
        </p><p>
          Select a predefined installation layout:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">STANDALONE</code>: Same layout as used for
              <code class="filename">.tar.gz</code> and <code class="filename">.zip</code>
              packages. This is the default.
            </p></li><li class="listitem"><p>
              <code class="literal">RPM</code>: Layout similar to RPM packages.
            </p></li><li class="listitem"><p>
              <code class="literal">SVR4</code>: Solaris package layout.
            </p></li><li class="listitem"><p>
              <code class="literal">DEB</code>: DEB package layout (experimental).
</p></li></ul>
</div>
<p>
          You can select a predefined layout but modify individual
          component installation locations by specifying other options.
          For example:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake . -DINSTALL_LAYOUT=SVR4 -DMYSQL_DATADIR=/var/mysql/data</code></strong>
</pre><p>
          The <a class="link" href="installing.html#option_cmake_install_layout"><code class="option">INSTALL_LAYOUT</code></a> value
          determines the default value of the
          <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a>,
          <a class="link" href="security.html#sysvar_keyring_encrypted_file_data"><code class="literal">keyring_encrypted_file_data</code></a>,
          and <a class="link" href="security.html#sysvar_keyring_file_data"><code class="literal">keyring_file_data</code></a> system
          variables. See the descriptions of those variables in
          <a class="xref" href="server-administration.html#server-system-variables" title="5.1.5 Server System Variables">Section 5.1.5, “Server System Variables”</a>, and
          <a class="xref" href="security.html#keyring-system-variables" title="6.5.4.11 Keyring System Variables">Section 6.5.4.11, “Keyring System Variables”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_install_libdir"></a>
          <a class="indexterm" name="idm139899655795440"></a>

          <a class="indexterm" name="idm139899655794048"></a>

          <code class="literal">-DINSTALL_LIBDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install library files.
        </p></li><li class="listitem"><p><a name="option_cmake_install_mandir"></a>
          <a class="indexterm" name="idm139899655790384"></a>

          <a class="indexterm" name="idm139899655788992"></a>

          <code class="literal">-DINSTALL_MANDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install manual pages.
        </p></li><li class="listitem"><p><a name="option_cmake_install_mysqlkeyringdir"></a>
          <a class="indexterm" name="idm139899655785328"></a>

          <a class="indexterm" name="idm139899655783936"></a>

          <code class="literal">-DINSTALL_MYSQLKEYRINGDIR=<em class="replaceable"><code>dir_path</code></em></code>
        </p><p>
          The default directory to use as the location of the
          <code class="literal">keyring_file</code> plugin data file. The default
          value is platform specific and depends on the value of the
          <a class="link" href="installing.html#option_cmake_install_layout"><code class="option">INSTALL_LAYOUT</code></a>
          <span class="command"><strong>CMake</strong></span> option; see the description of the
          <a class="link" href="security.html#sysvar_keyring_file_data"><code class="literal">keyring_file_data</code></a> system
          variable in <a class="xref" href="server-administration.html#server-system-variables" title="5.1.5 Server System Variables">Section 5.1.5, “Server System Variables”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_install_mysqlsharedir"></a>
          <a class="indexterm" name="idm139899655776560"></a>

          <a class="indexterm" name="idm139899655775168"></a>

          <code class="literal">-DINSTALL_MYSQLSHAREDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install shared data files.
        </p></li><li class="listitem"><p><a name="option_cmake_install_mysqltestdir"></a>
          <a class="indexterm" name="idm139899655771504"></a>

          <a class="indexterm" name="idm139899655770112"></a>

          <code class="literal">-DINSTALL_MYSQLTESTDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install the <code class="filename">mysql-test</code>
          directory. To suppress installation of this directory,
          explicitly set the option to the empty value
          (<a class="link" href="installing.html#option_cmake_install_mysqltestdir"><code class="option">-DINSTALL_MYSQLTESTDIR=</code></a>).
        </p></li><li class="listitem"><p><a name="option_cmake_install_pkgconfigdir"></a>
          <a class="indexterm" name="idm139899655764928"></a>

          <a class="indexterm" name="idm139899655763536"></a>

          <code class="literal">-DINSTALL_PKGCONFIGDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The directory in which to install the
          <code class="filename">mysqlclient.pc</code> file for use by
          <span class="command"><strong>pkg-config</strong></span>. The default value is
          <code class="literal">INSTALL_LIBDIR/pkgconfig</code>, unless
          <a class="link" href="installing.html#option_cmake_install_libdir"><code class="option">INSTALL_LIBDIR</code></a> ends with
          <code class="literal">/mysql</code>, in which case that is removed
          first.
        </p></li><li class="listitem"><p><a name="option_cmake_install_plugindir"></a>
          <a class="indexterm" name="idm139899655756464"></a>

          <a class="indexterm" name="idm139899655755072"></a>

          <code class="literal">-DINSTALL_PLUGINDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The location of the plugin directory.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#sysvar_plugin_dir"><code class="option">--plugin_dir</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_install_sbindir"></a>
          <a class="indexterm" name="idm139899655750112"></a>

          <a class="indexterm" name="idm139899655748720"></a>

          <code class="literal">-DINSTALL_SBINDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server.
        </p></li><li class="listitem"><p><a name="option_cmake_install_secure_file_privdir"></a>
          <a class="indexterm" name="idm139899655744064"></a>

          <a class="indexterm" name="idm139899655742672"></a>

          <code class="literal">-DINSTALL_SECURE_FILE_PRIVDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The default value for the
          <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a> system
          variable. The default value is platform specific and depends
          on the value of the
          <a class="link" href="installing.html#option_cmake_install_layout"><code class="option">INSTALL_LAYOUT</code></a>
          <span class="command"><strong>CMake</strong></span> option; see the description of the
          <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a> system
          variable in <a class="xref" href="server-administration.html#server-system-variables" title="5.1.5 Server System Variables">Section 5.1.5, “Server System Variables”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_install_sharedir"></a>
          <a class="indexterm" name="idm139899655735024"></a>

          <a class="indexterm" name="idm139899655733632"></a>

          <code class="literal">-DINSTALL_SHAREDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install <code class="filename">aclocal/mysql.m4</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_install_static_libraries"></a>
          <a class="indexterm" name="idm139899655729344"></a>

          <a class="indexterm" name="idm139899655727952"></a>

          <code class="literal">-DINSTALL_STATIC_LIBRARIES=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to install static libraries. The default is
          <code class="literal">ON</code>. If set to <code class="literal">OFF</code>, these
          libraries are not installed:
          <code class="filename">libmysqlclient.a</code>,
          <code class="filename">libmysqlservices.a</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_install_supportfilesdir"></a>
          <a class="indexterm" name="idm139899655721616"></a>

          <a class="indexterm" name="idm139899655720224"></a>

          <code class="literal">-DINSTALL_SUPPORTFILESDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          Where to install extra support files.
        </p></li><li class="listitem"><p><a name="option_cmake_link_randomize"></a>
          <code class="literal">-DLINK_RANDOMIZE=<em class="replaceable"><code>bool</code></em></code>
        </p><a class="indexterm" name="idm139899655715472"></a><a class="indexterm" name="idm139899655714080"></a><p>
          Whether to randomize the order of symbols in the
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> binary. The default is
          <code class="literal">OFF</code>. This option should be enabled only for
          debugging purposes.
        </p></li><li class="listitem"><p><a name="option_cmake_link_randomize_seed"></a>
          <code class="literal">-DLINK_RANDOMIZE_SEED=<em class="replaceable"><code>val</code></em></code>
        </p><a class="indexterm" name="idm139899655708624"></a><a class="indexterm" name="idm139899655707232"></a><p>
          Seed value for the
          <a class="link" href="installing.html#option_cmake_link_randomize"><code class="option">LINK_RANDOMIZE</code></a> option. The value
          is a string. The default is <code class="literal">mysql</code>, an
          arbitrary choice.
        </p></li><li class="listitem"><p><a name="option_cmake_mysql_datadir"></a>
          <a class="indexterm" name="idm139899655703120"></a>

          <a class="indexterm" name="idm139899655701728"></a>

          <code class="literal">-DMYSQL_DATADIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The location of the MySQL data directory.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#option_mysqld_datadir"><code class="option">--datadir</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_odbc_includes"></a>
          <a class="indexterm" name="idm139899655696768"></a>

          <a class="indexterm" name="idm139899655695376"></a>

          <code class="literal">-DODBC_INCLUDES=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The location of the ODBC includes directory, and may be used
          while configuring Connector/ODBC.
        </p></li><li class="listitem"><p><a name="option_cmake_odbc_lib_dir"></a>
          <a class="indexterm" name="idm139899655691568"></a>

          <a class="indexterm" name="idm139899655690176"></a>

          <code class="literal">-DODBC_LIB_DIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The location of the ODBC library directory, and may be used
          while configuring Connector/ODBC.
        </p></li><li class="listitem"><p><a name="option_cmake_sysconfdir"></a>
          <a class="indexterm" name="idm139899655686368"></a>

          <a class="indexterm" name="idm139899655684976"></a>

          <code class="literal">-DSYSCONFDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The default <code class="literal">my.cnf</code> option file directory.
        </p><p>
          This location cannot be set at server startup, but you can
          start the server with a given option file using the
          <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          option, where <em class="replaceable"><code>file_name</code></em> is the full
          path name to the file.
        </p></li><li class="listitem"><p><a name="option_cmake_systemd_pid_dir"></a>
          <a class="indexterm" name="idm139899655677920"></a>

          <a class="indexterm" name="idm139899655676432"></a>

          <a class="indexterm" name="idm139899655674944"></a>

          <code class="literal">-DSYSTEMD_PID_DIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The name of the directory in which to create the PID file when
          MySQL is managed by systemd. The default is
          <code class="filename">/var/run/mysqld</code>; this might be changed
          implicitly according to the
          <a class="link" href="installing.html#option_cmake_install_layout"><code class="option">INSTALL_LAYOUT</code></a> value.
        </p><p>
          This option is ignored unless
          <a class="link" href="installing.html#option_cmake_with_systemd"><code class="option">WITH_SYSTEMD</code></a> is enabled.
        </p></li><li class="listitem"><p><a name="option_cmake_systemd_service_name"></a>
          <a class="indexterm" name="idm139899655667472"></a>

          <a class="indexterm" name="idm139899655666016"></a>

          <a class="indexterm" name="idm139899655664512"></a>

          <code class="literal">-DSYSTEMD_SERVICE_NAME=<em class="replaceable"><code>name</code></em></code>
        </p><p>
          The name of the MySQL service to use when MySQL is managed by
          systemd. The default is <code class="literal">mysqld</code>; this might
          be changed implicitly according to the
          <a class="link" href="installing.html#option_cmake_install_layout"><code class="option">INSTALL_LAYOUT</code></a> value.
        </p><p>
          This option is ignored unless
          <a class="link" href="installing.html#option_cmake_with_systemd"><code class="option">WITH_SYSTEMD</code></a> is enabled.
        </p></li><li class="listitem"><p><a name="option_cmake_tmpdir"></a>
          <a class="indexterm" name="idm139899655657088"></a>

          <a class="indexterm" name="idm139899655655632"></a>

          <code class="literal">-DTMPDIR=<em class="replaceable"><code>dir_name</code></em></code>
        </p><p>
          The default location to use for the
          <a class="link" href="server-administration.html#sysvar_tmpdir"><code class="literal">tmpdir</code></a> system variable. If
          unspecified, the value defaults to <code class="literal">P_tmpdir</code>
          in <code class="literal">&lt;stdio.h&gt;</code>.
</p></li></ul>
</div>
<h4><a name="option_cmake_storage_engine_options"></a>Storage Engine Options</h4>
<p>
      Storage engines are built as plugins. You can build a plugin as a
      static module (compiled into the server) or a dynamic module
      (built as a dynamic library that must be installed into the server
      using the <a class="link" href="sql-syntax.html#install-plugin" title="13.7.4.4 INSTALL PLUGIN Syntax"><code class="literal">INSTALL PLUGIN</code></a> statement
      or the <a class="link" href="server-administration.html#option_mysqld_plugin-load"><code class="option">--plugin-load</code></a> option before
      it can be used). Some plugins might not support static or dynamic
      building.
    </p><p>
      The <a class="link" href="innodb-storage-engine.html" title="Chapter 15 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a>,
      <a class="link" href="storage-engines.html#myisam-storage-engine" title="16.2 The MyISAM Storage Engine"><code class="literal">MyISAM</code></a>,
      <a class="link" href="storage-engines.html#merge-storage-engine" title="16.7 The MERGE Storage Engine"><code class="literal">MERGE</code></a>,
      <a class="link" href="storage-engines.html#memory-storage-engine" title="16.3 The MEMORY Storage Engine"><code class="literal">MEMORY</code></a>, and
      <a class="link" href="storage-engines.html#csv-storage-engine" title="16.4 The CSV Storage Engine"><code class="literal">CSV</code></a> engines are mandatory (always
      compiled into the server) and need not be installed explicitly.
    </p><p>
      To compile a storage engine statically into the server, use
      <code class="literal">-DWITH_<em class="replaceable"><code>engine</code></em>_STORAGE_ENGINE=1</code>.
      Some permissible <em class="replaceable"><code>engine</code></em> values are
      <code class="literal">ARCHIVE</code>, <code class="literal">BLACKHOLE</code>,
      <code class="literal">EXAMPLE</code>, and <code class="literal">FEDERATED</code>.
      Examples:
    </p><pre data-lang="ini" class="programlisting">
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        It is not possible to compile without Performance Schema
        support. If it is desired to compile without particular types of
        instrumentation, that can be done with the following
        <span class="command"><strong>CMake</strong></span> options:
      </p><pre data-lang="simple" class="programlisting">
DISABLE_PSI_COND
DISABLE_PSI_DATA_LOCK
DISABLE_PSI_ERROR
DISABLE_PSI_FILE
DISABLE_PSI_IDLE
DISABLE_PSI_MEMORY
DISABLE_PSI_METADATA
DISABLE_PSI_MUTEX
DISABLE_PSI_PS
DISABLE_PSI_RWLOCK
DISABLE_PSI_SOCKET
DISABLE_PSI_SP
DISABLE_PSI_STAGE
DISABLE_PSI_STATEMENT
DISABLE_PSI_STATEMENT_DIGEST
DISABLE_PSI_TABLE
DISABLE_PSI_THREAD
DISABLE_PSI_TRANSACTION
</pre><p>
        For example, to compile without mutex instrumentation, configure
        MySQL using the <code class="option">-DDISABLE_PSI_MUTEX=1</code> option.
</p>
</div>
<p>
      To exclude a storage engine from the build, use
      <code class="literal">-DWITH_<em class="replaceable"><code>engine</code></em>_STORAGE_ENGINE=0</code>.
      Examples:
    </p><pre data-lang="ini" class="programlisting">
-DWITH_ARCHIVE_STORAGE_ENGINE=0
-DWITH_EXAMPLE_STORAGE_ENGINE=0
-DWITH_FEDERATED_STORAGE_ENGINE=0
</pre><p>
      It is also possible to exclude a storage engine from the build
      using
      <code class="literal">-DWITHOUT_<em class="replaceable"><code>engine</code></em>_STORAGE_ENGINE=1</code>
      (but
      <code class="literal">-DWITH_<em class="replaceable"><code>engine</code></em>_STORAGE_ENGINE=0</code>
      is preferred). Examples:
    </p><pre data-lang="ini" class="programlisting">
-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITHOUT_FEDERATED_STORAGE_ENGINE=1
</pre><p>
      If neither
      <code class="literal">-DWITH_<em class="replaceable"><code>engine</code></em>_STORAGE_ENGINE</code>
      nor
      <code class="literal">-DWITHOUT_<em class="replaceable"><code>engine</code></em>_STORAGE_ENGINE</code>
      are specified for a given storage engine, the engine is built as a
      shared module, or excluded if it cannot be built as a shared
      module.
</p>
<h4><a name="cmake-feature-options"></a>Feature Options</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_cmake_compilation_comment"></a>
          <a class="indexterm" name="idm139899655616560"></a>

          <a class="indexterm" name="idm139899655615104"></a>

          <code class="literal">-DCOMPILATION_COMMENT=<em class="replaceable"><code>string</code></em></code>
        </p><p>
          A descriptive comment about the compilation environment.
        </p></li><li class="listitem"><p><a name="option_cmake_default_charset"></a>
          <a class="indexterm" name="idm139899655610864"></a>

          <a class="indexterm" name="idm139899655609376"></a>

          <code class="literal">-DDEFAULT_CHARSET=<em class="replaceable"><code>charset_name</code></em></code>
        </p><p>
          The server character set. By default, MySQL uses the
          <code class="literal">utf8mb4</code> character set.
        </p><p>
          <em class="replaceable"><code>charset_name</code></em> may be one of
          <code class="literal">binary</code>, <code class="literal">armscii8</code>,
          <code class="literal">ascii</code>, <code class="literal">big5</code>,
          <code class="literal">cp1250</code>, <code class="literal">cp1251</code>,
          <code class="literal">cp1256</code>, <code class="literal">cp1257</code>,
          <code class="literal">cp850</code>, <code class="literal">cp852</code>,
          <code class="literal">cp866</code>, <code class="literal">cp932</code>,
          <code class="literal">dec8</code>, <code class="literal">eucjpms</code>,
          <code class="literal">euckr</code>, <code class="literal">gb2312</code>,
          <code class="literal">gbk</code>, <code class="literal">geostd8</code>,
          <code class="literal">greek</code>, <code class="literal">hebrew</code>,
          <code class="literal">hp8</code>, <code class="literal">keybcs2</code>,
          <code class="literal">koi8r</code>, <code class="literal">koi8u</code>,
          <code class="literal">latin1</code>, <code class="literal">latin2</code>,
          <code class="literal">latin5</code>, <code class="literal">latin7</code>,
          <code class="literal">macce</code>, <code class="literal">macroman</code>,
          <code class="literal">sjis</code>, <code class="literal">swe7</code>,
          <code class="literal">tis620</code>, <code class="literal">ucs2</code>,
          <code class="literal">ujis</code>, <code class="literal">utf8</code>,
          <code class="literal">utf8mb4</code>, <code class="literal">utf16</code>,
          <code class="literal">utf16le</code>, <code class="literal">utf32</code>. The
          permissible character sets are listed in the
          <code class="filename">cmake/character_sets.cmake</code> file as the
          value of <code class="literal">CHARSETS_AVAILABLE</code>.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#sysvar_character_set_server"><code class="option">--character_set_server</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_default_collation"></a>
          <a class="indexterm" name="idm139899655572336"></a>

          <a class="indexterm" name="idm139899655570880"></a>

          <code class="literal">-DDEFAULT_COLLATION=<em class="replaceable"><code>collation_name</code></em></code>
        </p><p>
          The server collation. By default, MySQL uses
          <code class="literal">utf8mb4_0900_ai_ci</code>. Use the
          <a class="link" href="sql-syntax.html#show-collation" title="13.7.6.4 SHOW COLLATION Syntax"><code class="literal">SHOW COLLATION</code></a> statement to
          determine which collations are available for each character
          set.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#sysvar_collation_server"><code class="option">--collation_server</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_cond"></a>
          <a class="indexterm" name="idm139899655563008"></a>

          <a class="indexterm" name="idm139899655561520"></a>

          <code class="literal">-DDISABLE_PSI_COND=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema condition
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_file"></a>
          <a class="indexterm" name="idm139899655556608"></a>

          <a class="indexterm" name="idm139899655555120"></a>

          <code class="literal">-DDISABLE_PSI_FILE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema file
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_idle"></a>
          <a class="indexterm" name="idm139899655550224"></a>

          <a class="indexterm" name="idm139899655548736"></a>

          <code class="literal">-DDISABLE_PSI_IDLE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema idle
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_memory"></a>
          <a class="indexterm" name="idm139899655543840"></a>

          <a class="indexterm" name="idm139899655542384"></a>

          <code class="literal">-DDISABLE_PSI_MEMORY=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema memory
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_metadata"></a>
          <a class="indexterm" name="idm139899655537424"></a>

          <a class="indexterm" name="idm139899655535968"></a>

          <code class="literal">-DDISABLE_PSI_METADATA=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema metadata
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_mutex"></a>
          <a class="indexterm" name="idm139899655530992"></a>

          <a class="indexterm" name="idm139899655529536"></a>

          <code class="literal">-DDISABLE_PSI_MUTEX=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema mutex
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_rwlock"></a>
          <a class="indexterm" name="idm139899655524576"></a>

          <a class="indexterm" name="idm139899655523120"></a>

          <code class="literal">-DDISABLE_PSI_RWLOCK=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema rwlock
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_socket"></a>
          <a class="indexterm" name="idm139899655518224"></a>

          <a class="indexterm" name="idm139899655516768"></a>

          <code class="literal">-DDISABLE_PSI_SOCKET=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema socket
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_sp"></a>
          <a class="indexterm" name="idm139899655511808"></a>

          <a class="indexterm" name="idm139899655510320"></a>

          <code class="literal">-DDISABLE_PSI_SP=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema stored program
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_stage"></a>
          <a class="indexterm" name="idm139899655505408"></a>

          <a class="indexterm" name="idm139899655503952"></a>

          <code class="literal">-DDISABLE_PSI_STAGE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema stage
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_statement"></a>
          <a class="indexterm" name="idm139899655498992"></a>

          <a class="indexterm" name="idm139899655497536"></a>

          <code class="literal">-DDISABLE_PSI_STATEMENT=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema statement
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_statement_digest"></a>
          <a class="indexterm" name="idm139899655492560"></a>

          <a class="indexterm" name="idm139899655491056"></a>

          <code class="literal">-DDISABLE_PSI_STATEMENT_DIGEST=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema statement_digest
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_table"></a>
          <a class="indexterm" name="idm139899655486192"></a>

          <a class="indexterm" name="idm139899655484736"></a>

          <code class="literal">-DDISABLE_PSI_TABLE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to exclude the Performance Schema table
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_shared"></a>
          <a class="indexterm" name="idm139899655479840"></a>

          <a class="indexterm" name="idm139899655478352"></a>

          <code class="literal">-DDISABLE_SHARED=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to disable building build shared libraries and compile
          position-dependent code. The default is <code class="literal">OFF</code>
          (compile position-independent code).
        </p><p>
          Enabling this option disables <code class="option">-fPIC</code>, with the
          consequence that shared libraries are not built, including
          plugins and components. Invoking <code class="literal">CMake</code>
          produces this warning: <code class="literal">Dynamic plugins are
          disabled.</code>
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_ps"></a>
          <a class="indexterm" name="idm139899655470944"></a>

          <a class="indexterm" name="idm139899655469456"></a>

          <code class="literal">-DDISABLE_PSI_PS=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Exclude the performance schema prepared statements instances
          instrumentation. The default is <code class="literal">OFF</code>
          (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_thread"></a>
          <a class="indexterm" name="idm139899655464544"></a>

          <a class="indexterm" name="idm139899655463088"></a>

          <code class="literal">-DDISABLE_PSI_THREAD=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Exclude the performance schema thread instrumentation. The
          default is <code class="literal">OFF</code> (include).
        </p><p>
          Only disable threads when building without any
          instrumentation, because other instrumentations have a
          dependency on threads.
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_transaction"></a>
          <a class="indexterm" name="idm139899655457584"></a>

          <a class="indexterm" name="idm139899655456128"></a>

          <code class="literal">-DDISABLE_PSI_TRANSACTION=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Exclude the performance schema transaction instrumentation.
          The default is <code class="literal">OFF</code> (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_data_lock"></a>
          <a class="indexterm" name="idm139899655451232"></a>

          <a class="indexterm" name="idm139899655449760"></a>

          <code class="literal">-DDISABLE_PSI_DATA_LOCK=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Exclude the performance schema data lock instrumentation. The
          default is <code class="literal">OFF</code> (include).
        </p></li><li class="listitem"><p><a name="option_cmake_disable_psi_error"></a>
          <a class="indexterm" name="idm139899655444864"></a>

          <a class="indexterm" name="idm139899655443408"></a>

          <code class="literal">-DDISABLE_PSI_ERROR=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Exclude the performance schema server error instrumentation.
          The default is <code class="literal">OFF</code> (include).
        </p></li><li class="listitem"><p><a name="option_cmake_download_boost"></a>
          <a class="indexterm" name="idm139899655438464"></a>

          <a class="indexterm" name="idm139899655436976"></a>

          <code class="literal">-DDOWNLOAD_BOOST=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to download the Boost library. The default is
          <code class="literal">OFF</code>.
        </p><p>
          See the <a class="link" href="installing.html#option_cmake_with_boost"><code class="option">WITH_BOOST</code></a> option for
          additional discussion about using Boost.
        </p></li><li class="listitem"><p><a name="option_cmake_download_boost_timeout"></a>
          <a class="indexterm" name="idm139899655430688"></a>

          <a class="indexterm" name="idm139899655429232"></a>

          <code class="literal">-DDOWNLOAD_BOOST_TIMEOUT=<em class="replaceable"><code>seconds</code></em></code>
        </p><p>
          The timeout in seconds for downloading the Boost library. The
          default is 600 seconds.
        </p><p>
          See the <a class="link" href="installing.html#option_cmake_with_boost"><code class="option">WITH_BOOST</code></a> option for
          additional discussion about using Boost.
        </p></li><li class="listitem"><p><a name="option_cmake_enable_debug_sync"></a>
          <a class="indexterm" name="idm139899655423584"></a>

          <a class="indexterm" name="idm139899655422128"></a>

          <code class="literal">-DENABLE_DEBUG_SYNC=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          As of MySQL 8.0.1, <code class="option">ENABLE_DEBUG_SYNC</code> is
          removed and enabling <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>
          enables Debug Sync.
        </p></li><li class="listitem"><p><a name="option_cmake_enable_downloads"></a>
          <a class="indexterm" name="idm139899655416496"></a>

          <a class="indexterm" name="idm139899655415008"></a>

          <a class="indexterm" name="idm139899655413520"></a>

          <code class="literal">-DENABLE_DOWNLOADS=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to download optional files. For example, with this
          option enabled, <span class="command"><strong>CMake</strong></span> downloads the Google
          Test distribution that is used by the test suite to run unit
          tests, or Ant and JUnit required for building GCS Java
          wrapper.
        </p></li><li class="listitem"><p><a name="option_cmake_enable_dtrace"></a>
          <a class="indexterm" name="idm139899655408848"></a>

          <a class="indexterm" name="idm139899655407360"></a>

          <code class="literal">-DENABLE_DTRACE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to include support for DTrace probes.
        </p><p>
          This option was removed in MySQL 8.0.1.
        </p></li><li class="listitem"><p><a name="option_cmake_enable_experimental_sysvars"></a>
          <a class="indexterm" name="idm139899655402640"></a>

          <a class="indexterm" name="idm139899655401184"></a>

          <a class="indexterm" name="idm139899655399680"></a>

          <code class="literal">-DENABLE_EXPERIMENTAL_SYSVARS=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable experimental <code class="literal">InnoDB</code>
          system variables. Experimental system variables are intended
          for those engaged in MySQL development, should only be used in
          a development or test environment, and may be removed without
          notice in a future MySQL release. For information about
          experimental system variables, refer to
          <code class="filename">/storage/innobase/handler/ha_innodb.cc</code> in
          the MySQL source tree. Experimental system variables can be
          identified by searching for
          <span class="quote">“<span class="quote">PLUGIN_VAR_EXPERIMENTAL</span>”</span>.
        </p></li><li class="listitem"><p><a name="option_cmake_enable_gcov"></a>
          <a class="indexterm" name="idm139899655393664"></a>

          <a class="indexterm" name="idm139899655392176"></a>

          <code class="literal">-DENABLE_GCOV=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to include gcov support (Linux only).
        </p></li><li class="listitem"><p><a name="option_cmake_enable_gprof"></a>
          <a class="indexterm" name="idm139899655388016"></a>

          <a class="indexterm" name="idm139899655386528"></a>

          <code class="literal">-DENABLE_GPROF=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable <code class="literal">gprof</code> (optimized Linux
          builds only).
        </p></li><li class="listitem"><p><a name="option_cmake_enabled_local_infile"></a>
          <a class="indexterm" name="idm139899655381648"></a>

          <a class="indexterm" name="idm139899655380192"></a>

          <code class="literal">-DENABLED_LOCAL_INFILE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          This option controls the compiled-in default
          <code class="literal">LOCAL</code> capability for the MySQL client
          library. Clients that make no explicit arrangements therefore
          have <code class="literal">LOCAL</code> capability disabled or enabled
          according to the
          <a class="link" href="installing.html#option_cmake_enabled_local_infile"><code class="option">ENABLED_LOCAL_INFILE</code></a> setting
          specified at MySQL build time.
        </p><p>
          By default, the client library in MySQL binary distributions
          is compiled with
          <a class="link" href="installing.html#option_cmake_enabled_local_infile"><code class="option">ENABLED_LOCAL_INFILE</code></a> disabled.
          If you compile MySQL from source, configure it with
          <a class="link" href="installing.html#option_cmake_enabled_local_infile"><code class="option">ENABLED_LOCAL_INFILE</code></a> disabled or
          enabled based on whether clients that make no explicit
          arrangements should have <code class="literal">LOCAL</code> capability
          disabled or enabled, respectively.
        </p><p>
          <a class="link" href="installing.html#option_cmake_enabled_local_infile"><code class="option">ENABLED_LOCAL_INFILE</code></a> controls
          the default for client-side <code class="literal">LOCAL</code>
          capability. For the server, the
          <a class="link" href="server-administration.html#sysvar_local_infile"><code class="literal">local_infile</code></a> system variable
          controls server-side <code class="literal">LOCAL</code> capability. To
          explicitly cause the server to refuse or permit
          <a class="link" href="sql-syntax.html#load-data" title="13.2.7 LOAD DATA INFILE Syntax"><code class="literal">LOAD DATA
          LOCAL</code></a> statements (regardless of how client programs
          and libraries are configured at build time or runtime), start
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with
          <a class="link" href="server-administration.html#sysvar_local_infile"><code class="literal">local_infile</code></a> disabled or
          enabled, respectively.
          <a class="link" href="server-administration.html#sysvar_local_infile"><code class="literal">local_infile</code></a> can also be set
          at runtime. See <a class="xref" href="security.html#load-data-local" title="6.1.6 Security Issues with LOAD DATA LOCAL">Section 6.1.6, “Security Issues with LOAD DATA LOCAL”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_enabled_profiling"></a>
          <a class="indexterm" name="idm139899655359712"></a>

          <a class="indexterm" name="idm139899655358256"></a>

          <code class="literal">-DENABLED_PROFILING=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable query profiling code (for the
          <a class="link" href="sql-syntax.html#show-profile" title="13.7.6.30 SHOW PROFILE Syntax"><code class="literal">SHOW PROFILE</code></a> and
          <a class="link" href="sql-syntax.html#show-profiles" title="13.7.6.31 SHOW PROFILES Syntax"><code class="literal">SHOW PROFILES</code></a> statements).
        </p></li><li class="listitem"><p><a name="option_cmake_force_unsupported_compiler"></a>
          <a class="indexterm" name="idm139899655351456"></a>

          <a class="indexterm" name="idm139899655350000"></a>

          <code class="literal">-DFORCE_UNSUPPORTED_COMPILER=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          By default, <span class="command"><strong>CMake</strong></span> checks for minimum
          versions of supported compilers: Visual Studio 2015 (Windows);
          GCC 4.8 or Clang 3.4 (Linux); Developer Studio 12.5 (Solaris
          server); Developer Studio 12.4 or GCC 4.8 (Solaris client
          library); Clang 3.6 (macOS), Clang 3.4 (FreeBSD). To disable
          this check, use
          <a class="link" href="installing.html#option_cmake_force_unsupported_compiler"><code class="option">-DFORCE_UNSUPPORTED_COMPILER=ON</code></a>.
        </p></li><li class="listitem"><p><a name="option_cmake_ignore_aio_check"></a>
          <a class="indexterm" name="idm139899655343760"></a>

          <a class="indexterm" name="idm139899655342272"></a>

          <a class="indexterm" name="idm139899655340784"></a>

          <code class="literal">-DIGNORE_AIO_CHECK=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          If the
          <a class="link" href="installing.html#option_cmake_build_config"><code class="option">-DBUILD_CONFIG=mysql_release</code></a>
          option is given on Linux, the <code class="literal">libaio</code>
          library must be linked in by default. If you do not have
          <code class="literal">libaio</code> or do not want to install it, you
          can suppress the check for it by specifying
          <a class="link" href="installing.html#option_cmake_ignore_aio_check"><code class="option">-DIGNORE_AIO_CHECK=1</code></a>.
        </p></li><li class="listitem"><p><a name="option_cmake_max_indexes"></a>
          <a class="indexterm" name="idm139899655333456"></a>

          <a class="indexterm" name="idm139899655331968"></a>

          <code class="literal">-DMAX_INDEXES=<em class="replaceable"><code>num</code></em></code>
        </p><p>
          The maximum number of indexes per table. The default is 64.
          The maximum is 255. Values smaller than 64 are ignored and the
          default of 64 is used.
        </p></li><li class="listitem"><p><a name="option_cmake_mysql_maintainer_mode"></a>
          <a class="indexterm" name="idm139899655327776"></a>

          <a class="indexterm" name="idm139899655326320"></a>

          <code class="literal">-DMYSQL_MAINTAINER_MODE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable a MySQL maintainer-specific development
          environment. If enabled, this option causes compiler warnings
          to become errors.
        </p></li><li class="listitem"><p><a name="option_cmake_mutex_type"></a>
          <a class="indexterm" name="idm139899655322016"></a>

          <a class="indexterm" name="idm139899655320560"></a>

          <code class="literal">-DMUTEX_TYPE=<em class="replaceable"><code>type</code></em></code>
        </p><p>
          The mutex type used by <code class="literal">InnoDB</code>. Options
          include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">event</code>: Use event mutexes. This is the
              default value and the original <code class="literal">InnoDB</code>
              mutex implementation.
            </p></li><li class="listitem"><p>
              <code class="literal">sys</code>: Use POSIX mutexes on UNIX systems.
              Use <code class="literal">CRITICAL_SECTION</code> onjects on
              Windows, if available.
            </p></li><li class="listitem"><p>
              <code class="literal">futex</code>: Use Linux futexes instead of
              condition variables to schedule waiting threads.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_mysqlx_tcp_port"></a>
          <a class="indexterm" name="idm139899655309120"></a>

          <a class="indexterm" name="idm139899655307632"></a>

          <a class="indexterm" name="idm139899655306144"></a>

          <a class="indexterm" name="idm139899655305072"></a>

          <a class="indexterm" name="idm139899655304000"></a>

          <code class="literal">-DMYSQLX_TCP_PORT=<em class="replaceable"><code>port_num</code></em></code>
        </p><p>
          The port number on which X Plugin listens for TCP/IP
          connections. The default is 33060.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="document-store.html#option_mysqld_mysqlx-port"><code class="option">--mysqlx-port</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_mysqlx_unix_addr"></a>
          <a class="indexterm" name="idm139899655298640"></a>

          <a class="indexterm" name="idm139899655297152"></a>

          <code class="literal">-DMYSQLX_UNIX_ADDR=<em class="replaceable"><code>file_name</code></em></code>
        </p><p>
          The Unix socket file path on which the server listens for
          X Plugin socket connections. This must be an absolute
          path name. The default is
          <code class="filename">/tmp/mysqlx.sock</code>.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="document-store.html#option_mysqld_mysqlx-socket"><code class="option">--mysqlx-socket</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_mysql_project_name"></a>
          <a class="indexterm" name="idm139899655290656"></a>

          <a class="indexterm" name="idm139899655289200"></a>

          <code class="literal">-DMYSQL_PROJECT_NAME=<em class="replaceable"><code>name</code></em></code>
        </p><p>
          For Windows or macOS, the project name to incorporate into the
          project file name.
        </p></li><li class="listitem"><p><a name="option_cmake_mysql_tcp_port"></a>
          <a class="indexterm" name="idm139899655284928"></a>

          <a class="indexterm" name="idm139899655283440"></a>

          <a class="indexterm" name="idm139899655281952"></a>

          <a class="indexterm" name="idm139899655280880"></a>

          <a class="indexterm" name="idm139899655279808"></a>

          <code class="literal">-DMYSQL_TCP_PORT=<em class="replaceable"><code>port_num</code></em></code>
        </p><p>
          The port number on which the server listens for TCP/IP
          connections. The default is 3306.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#option_mysqld_port"><code class="option">--port</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_mysql_unix_addr"></a>
          <a class="indexterm" name="idm139899655274656"></a>

          <a class="indexterm" name="idm139899655273168"></a>

          <code class="literal">-DMYSQL_UNIX_ADDR=<em class="replaceable"><code>file_name</code></em></code>
        </p><p>
          The Unix socket file path on which the server listens for
          socket connections. This must be an absolute path name. The
          default is <code class="filename">/tmp/mysql.sock</code>.
        </p><p>
          This value can be set at server startup with the
          <a class="link" href="server-administration.html#option_mysqld_socket"><code class="option">--socket</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_optimizer_trace"></a>
          <a class="indexterm" name="idm139899655266768"></a>

          <a class="indexterm" name="idm139899655265280"></a>

          <code class="literal">-DOPTIMIZER_TRACE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to support optimizer tracing. See
          <a class="ulink" href="http://dev.mysql.com/doc/internals/en/optimizer-tracing.html" target="_top">MySQL
          Internals: Tracing the Optimizer</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_reproducible_build"></a>
          <code class="literal">-DREPRODUCIBLE_BUILD=<em class="replaceable"><code>bool</code></em></code>
        </p><a class="indexterm" name="idm139899655259216"></a><a class="indexterm" name="idm139899655257760"></a><p>
          For builds on Linux systems, this option controls whether to
          take extra care to create a build result independent of build
          location and time.
        </p><p>
          This option was added in MySQL 8.0.11. As of MySQL 8.0.12, it
          defaults to <code class="literal">ON</code> for
          <code class="literal">RelWithDebInfo</code> builds.
        </p></li><li class="listitem"><p><a name="option_cmake_use_ld_gold"></a>
          <a class="indexterm" name="idm139899655252688"></a>

          <a class="indexterm" name="idm139899655251200"></a>

          <code class="literal">-DUSE_LD_GOLD=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          <span class="command"><strong>CMake</strong></span> causes the build process to link with
          the GNU <span class="command"><strong>gold</strong></span> linker if it is available. To
          suppress use of this linker, specify the
          <a class="link" href="installing.html#option_cmake_use_ld_gold"><code class="option">-DUSE_LD_GOLD=0</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_win_debug_no_inline"></a>
          <a class="indexterm" name="idm139899655244624"></a>

          <a class="indexterm" name="idm139899655243168"></a>

          <code class="literal">-DWIN_DEBUG_NO_INLINE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to disable function inlining on Windows. The default
          is off (inlining enabled).
        </p></li><li class="listitem"><p><a name="option_cmake_with_ant"></a>
          <a class="indexterm" name="idm139899655238944"></a>

          <a class="indexterm" name="idm139899655237488"></a>

          <code class="literal">-DWITH_ANT=<em class="replaceable"><code>path_name</code></em></code>
        </p><p>
          Set the path to Ant, required when building GCS Java wrapper.
          Works in a similar way to the existing
          <a class="link" href="installing.html#option_cmake_with_boost"><code class="option">WITH_BOOST</code></a> CMake option. Set
          <a class="link" href="installing.html#option_cmake_with_ant"><code class="option">WITH_ANT</code></a> to the path of a
          directory where the Ant tarball, or an already unpacked
          archive, is saved. When <a class="link" href="installing.html#option_cmake_with_ant"><code class="option">WITH_ANT</code></a>
          is not set, or is set with the special value
          <code class="literal">system</code>, the build assumes a binary
          <span class="command"><strong>ant</strong></span> exists in <code class="literal">$PATH</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_asan"></a>
          <a class="indexterm" name="idm139899655228032"></a>

          <a class="indexterm" name="idm139899655226576"></a>

          <code class="literal">-DWITH_ASAN=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable the AddressSanitizer, for compilers that
          support it. The default is off.
        </p></li><li class="listitem"><p><a name="option_cmake_with_asan_scope"></a>
          <a class="indexterm" name="idm139899655222304"></a>

          <a class="indexterm" name="idm139899655220816"></a>

          <code class="literal">-DWITH_ASAN_SCOPE=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable the AddressSanitizer
          <code class="literal">-fsanitize-address-use-after-scope</code> Clang
          flag for use-after-scope detection. The default is off. To use
          this option, <code class="literal">-DWITH_ASAN</code> must
          also be enabled.
        </p></li><li class="listitem"><p><a name="option_cmake_with_authentication_ldap"></a>
          <code class="literal">-DWITH_AUTHENTICATION_LDAP=<em class="replaceable"><code>bool</code></em></code>
        </p><a class="indexterm" name="idm139899655213744"></a><a class="indexterm" name="idm139899655212240"></a><a class="indexterm" name="idm139899655210736"></a><p>
          Whether to report an error if the LDAP authentication plugins
          cannot be built:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              If this option is disabled (the default), the LDAP plugins
              are built if the required header files and libraries are
              found. If they are not, <span class="command"><strong>CMake</strong></span> displays
              a note about it.
            </p></li><li class="listitem"><p>
              If this option is enabled, a failure to find the required
              header file andlibraries causes <span class="command"><strong>CMake</strong></span>
              to produce an error, preventing the server from being
              built.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_with_authentication_pam"></a>
          <a class="indexterm" name="idm139899655203840"></a>

          <a class="indexterm" name="idm139899655202384"></a>

          <code class="literal">-DWITH_AUTHENTICATION_PAM=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to build the PAM authentication plugin, for source
          trees that include this plugin. (See
          <a class="xref" href="security.html#pam-pluggable-authentication" title="6.5.1.5 PAM Pluggable Authentication">Section 6.5.1.5, “PAM Pluggable Authentication”</a>.) If this
          option is specified and the plugin cannot be compiled, the
          build fails.
        </p></li><li class="listitem"><p><a name="option_cmake_with_aws_sdk"></a>
          <code class="literal">-DWITH_AWS_SDK=<em class="replaceable"><code>path_name</code></em></code>
        </p><a class="indexterm" name="idm139899655196064"></a><a class="indexterm" name="idm139899655194576"></a><p>
          The location of the Amazon Web Services software development
          kit.
        </p></li><li class="listitem"><p><a name="option_cmake_with_boost"></a>
          <a class="indexterm" name="idm139899655191488"></a>

          <a class="indexterm" name="idm139899655190032"></a>

          <code class="literal">-DWITH_BOOST=<em class="replaceable"><code>path_name</code></em></code>
        </p><p>
          The Boost library is required to build MySQL. These
          <span class="command"><strong>CMake</strong></span> options enable control over the
          library source location, and whether to download it
          automatically:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <a class="link" href="installing.html#option_cmake_with_boost"><code class="option">-DWITH_BOOST=<em class="replaceable"><code>path_name</code></em></code></a>
              specifies the Boost library directory location. It is also
              possible to specify the Boost location by setting the
              <code class="literal">BOOST_ROOT</code> or
              <code class="literal">WITH_BOOST</code> environment variable.
            </p><p>
              <a class="link" href="installing.html#option_cmake_with_boost"><code class="option">-DWITH_BOOST=system</code></a> is also
              permitted and indicates that the correct version of Boost
              is installed on the compilation host in the standard
              location. In this case, the installed version of Boost is
              used rather than any version included with a MySQL source
              distribution.
            </p></li><li class="listitem"><p>
              <a class="link" href="installing.html#option_cmake_download_boost"><code class="option">-DDOWNLOAD_BOOST=<em class="replaceable"><code>bool</code></em></code></a>
              specifies whether to download the Boost source if it is
              not present in the specified location. The default is
              <code class="literal">OFF</code>.
            </p></li><li class="listitem"><p>
              <a class="link" href="installing.html#option_cmake_download_boost_timeout"><code class="option">-DDOWNLOAD_BOOST_TIMEOUT=<em class="replaceable"><code>seconds</code></em></code></a>
              the timeout in seconds for downloading the Boost library.
              The default is 600 seconds.
</p></li></ul>
</div>
<p>
          For example, if you normally build MySQL placing the object
          output in the <code class="filename">bld</code> subdirectory of your
          MySQL source tree, you can build with Boost like this:
        </p><pre data-lang="terminal" class="programlisting">
mkdir bld
cd bld
cmake .. -DDOWNLOAD_BOOST=ON -DWITH_BOOST=$HOME/my_boost
</pre><p>
          This causes Boost to be downloaded into the
          <code class="filename">my_boost</code> directory under your home
          directory. If the required Boost version is already there, no
          download is done. If the required Boost version changes, the
          newer version is downloaded.
        </p><p>
          If Boost is already installed locally and your compiler finds
          the Boost header files on its own, it may not be necessary to
          specify the preceding <span class="command"><strong>CMake</strong></span> options.
          However, if the version of Boost required by MySQL changes and
          the locally installed version has not been upgraded, you may
          have build problems. Using the <span class="command"><strong>CMake</strong></span>
          options should give you a successful build.
        </p><p>
          With the above settings that allow Boost download into a
          specified location, when the required Boost version changes,
          you need to remove the <code class="literal">bld</code> folder, recreate
          it, and perform the <span class="command"><strong>cmake</strong></span> step again.
          Otherwise, the new Boost version might not get downloaded, and
          compilation might fail.
        </p></li><li class="listitem"><p><a name="option_cmake_with_client_protocol_tracing"></a>
          <a class="indexterm" name="idm139899655166208"></a>

          <a class="indexterm" name="idm139899655164704"></a>

          <code class="literal">-DWITH_CLIENT_PROTOCOL_TRACING=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to build the client-side protocol tracing framework
          into the client library. By default, this option is enabled.
        </p><p>
          For information about writing protocol trace client plugins,
          see <a class="xref" href="extending-mysql.html#writing-protocol-trace-plugins" title="28.2.4.11 Writing Protocol Trace Plugins">Section 28.2.4.11, “Writing Protocol Trace Plugins”</a>.
        </p><p>
          See also the
          <a class="link" href="installing.html#option_cmake_with_test_trace_plugin"><code class="option">WITH_TEST_TRACE_PLUGIN</code></a> option.
        </p></li><li class="listitem"><p><a name="option_cmake_with_curl"></a>
          <code class="literal">-DWITH_CURL=<em class="replaceable"><code>curl_type</code></em></code>
        </p><a class="indexterm" name="idm139899655156592"></a><a class="indexterm" name="idm139899655155104"></a><p>
          The location of the <span class="command"><strong>curl</strong></span> library.
          <em class="replaceable"><code>curl_type</code></em> can be
          <code class="literal">system</code> (use the system
          <span class="command"><strong>curl</strong></span> library) or a path name to the
          <span class="command"><strong>curl</strong></span> library.
        </p></li><li class="listitem"><p><a name="option_cmake_with_debug"></a>
          <a class="indexterm" name="idm139899655148752"></a>

          <a class="indexterm" name="idm139899655147296"></a>

          <code class="literal">-DWITH_DEBUG=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to include debugging support.
        </p><p>
          Configuring MySQL with debugging support enables you to use
          the <a class="link" href="server-administration.html#option_mysqld_debug"><code class="option">--debug="d,parser_debug"</code></a>
          option when you start the server. This causes the Bison parser
          that is used to process SQL statements to dump a parser trace
          to the server's standard error output. Typically, this output
          is written to the error log.
        </p><p>
          Sync debug checking for the <code class="literal">InnoDB</code> storage
          engine is defined under <code class="literal">UNIV_DEBUG</code> and is
          available when debugging support is compiled in using the
          <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a> option. When
          debugging support is compiled in, the
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_sync_debug"><code class="literal">innodb_sync_debug</code></a>
          configuration option can be used to enable or disable
          <code class="literal">InnoDB</code> sync debug checking.
        </p><p>
          Enabling <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a> also enables
          Debug Sync. This facility is used for testing and debugging.
          When compiled in, Debug Sync is disabled by default at
          runtime. To enable it, start <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with
          the
          <a class="link" href="server-administration.html#option_mysqld_debug-sync-timeout"><code class="option">--debug-sync-timeout=<em class="replaceable"><code>N</code></em></code></a>
          option, where <em class="replaceable"><code>N</code></em> is a timeout value
          greater than 0. (The default value is 0, which disables Debug
          Sync.) <em class="replaceable"><code>N</code></em> becomes the default
          timeout for individual synchronization points.
        </p><p>
          Sync debug checking for the <code class="literal">InnoDB</code> storage
          engine is available when debugging support is compiled in
          using the <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a> option.
        </p><p>
          For a description of the Debug Sync facility and how to use
          synchronization points, see
          <a class="ulink" href="http://dev.mysql.com/doc/internals/en/test-synchronization.html" target="_top">MySQL
          Internals: Test Synchronization</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_default_feature_set"></a>
          <a class="indexterm" name="idm139899655127600"></a>

          <a class="indexterm" name="idm139899655126144"></a>

          <code class="literal">-DWITH_DEFAULT_FEATURE_SET=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to use the flags from
          <code class="filename">cmake/build_configurations/feature_set.cmake</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_editline"></a>
          <a class="indexterm" name="idm139899655121168"></a>

          <a class="indexterm" name="idm139899655119680"></a>

          <code class="literal">-DWITH_EDITLINE=<em class="replaceable"><code>value</code></em></code>
        </p><p>
          Which <code class="literal">libedit</code>/<code class="literal">editline</code>
          library to use. The permitted values are
          <code class="literal">bundled</code> (the default) and
          <code class="literal">system</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_icu"></a>
          <code class="literal">-DWITH_ICU={<em class="replaceable"><code>icu_type</code></em>|<em class="replaceable"><code>path_name</code></em>}</code>
        </p><a class="indexterm" name="idm139899655111088"></a><a class="indexterm" name="idm139899655109600"></a><p>
          MySQL uses International Components for Unicode (ICU) to
          support regular expression operations. The
          <code class="option">WITH_ICU</code> option indicates the type of ICU
          support to include or the path name to the ICU installation to
          use.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <em class="replaceable"><code>icu_type</code></em> can be one of the
              following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; "><li class="listitem"><p>
                  <code class="literal">bundled</code>: Use the ICU library
                  bundled with the distribution. This is the default,
                  and is the only supported option for Windows.
                </p></li><li class="listitem"><p>
                  <code class="literal">system</code>: Use the system ICU library.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              <em class="replaceable"><code>path_name</code></em> is the path name to
              the ICU installation to use. This can be preferable to
              using the <em class="replaceable"><code>icu_type</code></em> value of
              <code class="literal">system</code> because it can prevent CMake
              from detecting and using an older or incorrect ICU version
              installed on the system. (Another permitted way to do the
              same thing is to set <code class="option">WITH_ICU</code> to
              <code class="literal">system</code> and set the
              <code class="option">CMAKE_PREFIX_PATH</code> option to
              <em class="replaceable"><code>path_name</code></em>.)
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_with_innodb_extra_debug"></a>
          <a class="indexterm" name="idm139899655095888"></a>

          <a class="indexterm" name="idm139899655094432"></a>

          <code class="literal">-DWITH_INNODB_EXTRA_DEBUG=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to include extra InnoDB debugging support.
        </p><p>
          Enabling <code class="literal">WITH_INNODB_EXTRA_DEBUG</code> turns on
          extra InnoDB debug checks. This option can only be enabled
          when <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a> is enabled.
        </p></li><li class="listitem"><p><a name="option_cmake_with_innodb_memcached"></a>
          <a class="indexterm" name="idm139899655088016"></a>

          <a class="indexterm" name="idm139899655086560"></a>

          <code class="literal">-DWITH_INNODB_MEMCACHED=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to generate memcached shared libraries
          (<code class="filename">libmemcached.so</code> and
          <code class="filename">innodb_engine.so</code>).
        </p></li><li class="listitem"><p><a name="option_cmake_with_keyring_test"></a>
          <a class="indexterm" name="idm139899655080880"></a>

          <a class="indexterm" name="idm139899655079424"></a>

          <code class="literal">-DWITH_KEYRING_TEST=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to build the test program that accompanies the
          <code class="literal">keyring_file</code> plugin. The default is
          <code class="literal">OFF</code>. Test file source code is located in
          the <code class="filename">plugin/keyring/keyring-test</code>
          directory.
        </p></li><li class="listitem"><p><a name="option_cmake_with_libevent"></a>
          <a class="indexterm" name="idm139899655072976"></a>

          <a class="indexterm" name="idm139899655071488"></a>

          <code class="literal">-DWITH_LIBEVENT=<em class="replaceable"><code>string</code></em></code>
        </p><p>
          Which <code class="literal">libevent</code> library to use. Permitted
          values are <code class="literal">bundled</code> (default),
          <code class="literal">system</code>, and <code class="literal">yes</code>. If you
          specify <code class="literal">system</code> or <code class="literal">yes</code>,
          the system <code class="literal">libevent</code> library is used if
          present. If the system library is not found, the bundled
          <code class="literal">libevent</code> library is used. The
          <code class="literal">libevent</code> library is required by
          <code class="literal">InnoDB</code> memcached.
        </p></li><li class="listitem"><p><a name="option_cmake_with_libwrap"></a>
          <a class="indexterm" name="idm139899655060080"></a>

          <a class="indexterm" name="idm139899655058592"></a>

          <code class="literal">-DWITH_LIBWRAP=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to include <code class="literal">libwrap</code> (TCP wrappers)
          support.
        </p></li><li class="listitem"><p><a name="option_cmake_with_lz4"></a>
          <a class="indexterm" name="idm139899655053824"></a>

          <a class="indexterm" name="idm139899655052368"></a>

          <code class="literal">-DWITH_LZ4=<em class="replaceable"><code>lz4_type</code></em></code>
        </p><p>
          The <a class="link" href="installing.html#option_cmake_with_lz4"><code class="option">WITH_LZ4</code></a> indicates the
          source of <code class="literal">zlib</code> support:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">bundled</code>: Use the <code class="literal">lz4</code>
              library bundled with the distribution. This is the
              default.
            </p></li><li class="listitem"><p>
              <code class="literal">system</code>: Use the system
              <code class="literal">lz4</code> library. If
              <a class="link" href="installing.html#option_cmake_with_lz4"><code class="option">WITH_LZ4</code></a> is set to this
              value, the <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a> utility is
              not built. In this case, the system <span class="command"><strong>lz4</strong></span>
              command can be used instead.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_with_msan"></a>
          <a class="indexterm" name="idm139899655038480"></a>

          <a class="indexterm" name="idm139899655037024"></a>

          <code class="literal">-DWITH_MSAN=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable MemorySanitizer, for compilers that support
          it. The default is off.
        </p><p>
          For this option to have an effect if enabled, all libraries
          linked to MySQL must also have been compiled with the option
          enabled.
        </p></li><li class="listitem"><p><a name="option_cmake_with_mecab"></a>
          <a class="indexterm" name="idm139899655032240"></a>

          <a class="indexterm" name="idm139899655030784"></a>

          <code class="literal">-DWITH_MECAB={disabled|system|<em class="replaceable"><code>path_name</code></em>}</code>
        </p><p>
          Use this option to compile the MeCab parser. If you have
          installed MeCab to its default installation directory, set
          <code class="literal">-DWITH_MECAB=system</code>. The
          <code class="literal">system</code> option applies to MeCab
          installations performed from source or from binaries using a
          native package management utility. If you installed MeCab to a
          custom installation directory, specify the path to the MeCab
          installation. For example,
          <code class="literal">-DWITH_MECAB=/opt/mecab</code>. If the
          <code class="literal">system</code> option does not work, specifying the
          MeCab installation path should work in all cases.
        </p><p>
          For related information, see
          <a class="xref" href="functions.html#fulltext-search-mecab" title="12.9.9 MeCab Full-Text Parser Plugin">Section 12.9.9, “MeCab Full-Text Parser Plugin”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_mscrt_debug"></a>
          <a class="indexterm" name="idm139899655021872"></a>

          <a class="indexterm" name="idm139899655020384"></a>

          <code class="literal">-DWITH_MSCRT_DEBUG=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable Visual Studio CRT memory leak tracing. The
          default is <code class="literal">OFF</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_numa"></a>
          <a class="indexterm" name="idm139899655015504"></a>

          <a class="indexterm" name="idm139899655014048"></a>

          <code class="literal">-DWITH_NUMA=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Explicitly set the NUMA memory allocation policy.
          <span class="command"><strong>CMake</strong></span> sets the default
          <a class="link" href="installing.html#option_cmake_with_numa"><code class="option">WITH_NUMA</code></a> value based on whether
          the current platform has <code class="literal">NUMA</code> support. For
          platforms without NUMA support, <span class="command"><strong>CMake</strong></span>
          behaves as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              With no NUMA option (the normal case),
              <span class="command"><strong>CMake</strong></span> continues normally, producing
              only this warning: NUMA library missing or required
              version not available
            </p></li><li class="listitem"><p>
              With <a class="link" href="installing.html#option_cmake_with_numa"><code class="option">-DWITH_NUMA=ON</code></a>,
              <span class="command"><strong>CMake</strong></span> aborts with this error: NUMA
              library missing or required version not available
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_with_protobuf"></a>
          <a class="indexterm" name="idm139899655002048"></a>

          <a class="indexterm" name="idm139899655000560"></a>

          <code class="literal">-DWITH_PROTOBUF=<em class="replaceable"><code>protobuf_type</code></em></code>
        </p><p>
          Which Protocol Buffers package to use.
          <em class="replaceable"><code>protobuf_type</code></em> can be one of the
          following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">bundled</code>: Use the package bundled with
              the distribution. This is the default.
            </p></li><li class="listitem"><p>
              <code class="literal">system</code>: Use the package installed on
              the system.
</p></li></ul>
</div>
<p>
          Other values are ignored, with a fallback to
          <code class="literal">bundled</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_rapid"></a>
          <a class="indexterm" name="idm139899654991248"></a>

          <a class="indexterm" name="idm139899654989792"></a>

          <code class="literal">-DWITH_RAPID=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to build the rapid development cycle plugins. When
          enabled, a <code class="filename">rapid</code> directory is created in
          the build tree containing these plugins. When disabled, no
          <code class="filename">rapid</code> directory is created in the build
          tree. The default is <code class="literal">ON</code>, unless the
          <code class="filename">rapid</code> directory is removed from the
          source tree, in which case the default becomes
          <code class="literal">OFF</code>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_lzma"></a>
          <code class="literal">-DWITH_LZMA=<em class="replaceable"><code>lzma_type</code></em></code>
        </p><a class="indexterm" name="idm139899654980832"></a><a class="indexterm" name="idm139899654979344"></a><p>
          The type of LZMA library support to include.
          <em class="replaceable"><code>lzma_type</code></em> can be one of the
          following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">bundled</code>: Use the LZMA library bundled
              with the distribution. This is the default.
            </p></li><li class="listitem"><p>
              <code class="literal">system</code>: Use the system LZMA library.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_with_re2"></a>
          <code class="literal">-DWITH_RE2=<em class="replaceable"><code>re2_type</code></em></code>
        </p><a class="indexterm" name="idm139899654971264"></a><a class="indexterm" name="idm139899654969776"></a><p>
          The type of RE2 library support to include.
          <em class="replaceable"><code>re2_type</code></em> can be one of the
          following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">bundled</code>: Use the RE2 library bundled
              with the distribution. This is the default.
            </p></li><li class="listitem"><p>
              <code class="literal">system</code>: Use the system RE2 library.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_with_ssl"></a>
          <a class="indexterm" name="idm139899654962832"></a>

          <a class="indexterm" name="idm139899654961376"></a>

          <code class="literal">-DWITH_SSL={<em class="replaceable"><code>ssl_type</code></em></code>|<em class="replaceable"><code>path_name</code></em>}
        </p><p>
          The type of SSL support to include or the path name to the
          OpenSSL installation to use.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <em class="replaceable"><code>ssl_type</code></em> can be one of the
              following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; "><li class="listitem"><p>
                  <code class="literal">system</code>: Use the system SSL library.
                  This is the default.
                </p><p>
                  On macOS and Windows, using <code class="literal">system</code>
                  builds as if CMake was invoked with
                  <em class="replaceable"><code>path_name</code></em> and points to the
                  installed OpenSSL library. This is because they do not
                  have system SSL libraries. On macOS, <span class="emphasis"><em>brew
                  install openssl</em></span> installs to
                  <code class="filename">/usr/local/opt/openssl</code> and
                  <code class="literal">system</code> will find it. On Windows, it
                  checks <span class="emphasis"><em>%ProgramFiles%/OpenSSL</em></span>,
                  <span class="emphasis"><em>%ProgramFiles%/OpenSSL-Win32</em></span>,
                  <span class="emphasis"><em>%ProgramFiles%/OpenSSL-Win64</em></span>,
                  <span class="emphasis"><em>C:/OpenSSL</em></span>,
                  <span class="emphasis"><em>C:/OpenSSL-Win32</em></span>, and
                  <span class="emphasis"><em>C:/OpenSSL-Win64</em></span>.
                </p></li><li class="listitem"><p>
                  <code class="literal">yes</code>: This is a synonym for
                  <code class="literal">system</code>.
                </p></li><li class="listitem"><p>
                  <code class="literal">wolfssl</code>: Use the wolfSSL library.
                  To use this option value, you must follow the
                  instructions in the
                  <code class="filename">extra/README-wolfssl.txt</code> file.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              <em class="replaceable"><code>path_name</code></em> is the path name to
              the OpenSSL installation to use. This can be preferable to
              using the <em class="replaceable"><code>ssl_type</code></em> value of
              <code class="literal">system</code> because it can prevent CMake
              from detecting and using an older or incorrect OpenSSL
              version installed on the system. (Another permitted way to
              do the same thing is to set <code class="option">WITH_SSL</code> to
              <code class="literal">system</code> and set the
              <code class="option">CMAKE_PREFIX_PATH</code> option to
              <em class="replaceable"><code>path_name</code></em>.)
</p></li></ul>
</div>
<p>
          For information about using SSL support, see
          <a class="xref" href="security.html#encrypted-connections" title="6.4 Using Encrypted Connections">Section 6.4, “Using Encrypted Connections”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_systemd"></a>
          <a class="indexterm" name="idm139899654936048"></a>

          <a class="indexterm" name="idm139899654934560"></a>

          <a class="indexterm" name="idm139899654933072"></a>

          <code class="literal">-DWITH_SYSTEMD=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable installation of systemd support files. By
          default, this option is disabled. When enabled, systemd
          support files are installed, and scripts such as
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> and the System V initialization
          script are not installed. On platforms where systemd is not
          available, enabling <a class="link" href="installing.html#option_cmake_with_systemd"><code class="option">WITH_SYSTEMD</code></a>
          results in an error from <span class="command"><strong>CMake</strong></span>.
        </p><p>
          For more information about using systemd, see
          <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>. That section also includes
          information about specifying options previously specified in
          <code class="literal">[mysqld_safe]</code> option groups. Because
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is not installed when systemd
          is used, such options must be specified another way.
        </p></li><li class="listitem"><p><a name="option_cmake_with_system_libs"></a>
          <code class="literal">-DWITH_SYSTEM_LIBS=<em class="replaceable"><code>bool</code></em></code>
        </p><a class="indexterm" name="idm139899654921296"></a><a class="indexterm" name="idm139899654919808"></a><p>
          This option serves as an <span class="quote">“<span class="quote">umbrella</span>”</span> option to set
          the <code class="literal">system</code> value of any of the following
          <span class="command"><strong>CMake</strong></span> options that are not set explicitly:
          <a class="link" href="installing.html#option_cmake_with_curl"><code class="option">WITH_CURL</code></a>,
          <a class="link" href="installing.html#option_cmake_with_editline"><code class="option">WITH_EDITLINE</code></a>,
          <a class="link" href="installing.html#option_cmake_with_icu"><code class="option">WITH_ICU</code></a>,
          <a class="link" href="installing.html#option_cmake_with_libevent"><code class="option">WITH_LIBEVENT</code></a>,
          <a class="link" href="installing.html#option_cmake_with_lz4"><code class="option">WITH_LZ4</code></a>,
          <a class="link" href="installing.html#option_cmake_with_lzma"><code class="option">WITH_LZMA</code></a>,
          <a class="link" href="installing.html#option_cmake_with_protobuf"><code class="option">WITH_PROTOBUF</code></a>,
          <a class="link" href="installing.html#option_cmake_with_re2"><code class="option">WITH_RE2</code></a>,
          <a class="link" href="installing.html#option_cmake_with_ssl"><code class="option">WITH_SSL</code></a>,
          <a class="link" href="installing.html#option_cmake_with_zlib"><code class="option">WITH_ZLIB</code></a>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_test_trace_plugin"></a>
          <a class="indexterm" name="idm139899654905120"></a>

          <a class="indexterm" name="idm139899654903664"></a>

          <code class="literal">-DWITH_TEST_TRACE_PLUGIN=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to build the test protocol trace client plugin (see
          <a class="xref" href="extending-mysql.html#test-protocol-trace-plugin" title="28.2.4.11.1 Using the Test Protocol Trace Plugin">Section 28.2.4.11.1, “Using the Test Protocol Trace Plugin”</a>). By default,
          this option is disabled. Enabling this option has no effect
          unless the
          <a class="link" href="installing.html#option_cmake_with_client_protocol_tracing"><code class="option">WITH_CLIENT_PROTOCOL_TRACING</code></a>
          option is enabled. If MySQL is configured with both options
          enabled, the <code class="literal">libmysqlclient</code> client library
          is built with the test protocol trace plugin built in, and all
          the standard MySQL clients load the plugin. However, even when
          the test plugin is enabled, it has no effect by default.
          Control over the plugin is afforded using environment
          variables; see <a class="xref" href="extending-mysql.html#test-protocol-trace-plugin" title="28.2.4.11.1 Using the Test Protocol Trace Plugin">Section 28.2.4.11.1, “Using the Test Protocol Trace Plugin”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Do <span class="emphasis"><em>not</em></span> enable the
            <a class="link" href="installing.html#option_cmake_with_test_trace_plugin"><code class="option">WITH_TEST_TRACE_PLUGIN</code></a> option
            if you want to use your own protocol trace plugins because
            only one such plugin can be loaded at a time and an error
            occurs for attempts to load a second one. If you have
            already built MySQL with the test protocol trace plugin
            enabled to see how it works, you must rebuild MySQL without
            it before you can use your own plugins.
</p>
</div>
<p>
          For information about writing trace plugins, see
          <a class="xref" href="extending-mysql.html#writing-protocol-trace-plugins" title="28.2.4.11 Writing Protocol Trace Plugins">Section 28.2.4.11, “Writing Protocol Trace Plugins”</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_tsan"></a>
          <a class="indexterm" name="idm139899654891792"></a>

          <a class="indexterm" name="idm139899654890336"></a>

          <code class="literal">-DWITH_TSAN=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable the ThreadSanitizer, for compilers that
          support it. The default is off.
        </p></li><li class="listitem"><p><a name="option_cmake_with_ubsan"></a>
          <a class="indexterm" name="idm139899654886192"></a>

          <a class="indexterm" name="idm139899654884736"></a>

          <code class="literal">-DWITH_UBSAN=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to enable the Undefined Behavior Sanitizer, for
          compilers that support it. The default is off.
        </p></li><li class="listitem"><p><a name="option_cmake_with_unit_tests"></a>
          <a class="indexterm" name="idm139899654880512"></a>

          <a class="indexterm" name="idm139899654879024"></a>

          <code class="literal">-DWITH_UNIT_TESTS={ON|OFF}</code>
        </p><p>
          If enabled, compile MySQL with unit tests. The default is ON
          unless the server is not being compiled.
        </p></li><li class="listitem"><p><a name="option_cmake_with_unixodbc"></a>
          <a class="indexterm" name="idm139899654875072"></a>

          <a class="indexterm" name="idm139899654873584"></a>

          <code class="literal">-DWITH_UNIXODBC=<em class="replaceable"><code>1</code></em></code>
        </p><p>
          Enables unixODBC support, for Connector/ODBC.
        </p></li><li class="listitem"><p><a name="option_cmake_with_valgrind"></a>
          <a class="indexterm" name="idm139899654869456"></a>

          <a class="indexterm" name="idm139899654867968"></a>

          <code class="literal">-DWITH_VALGRIND=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to compile in the Valgrind header files, which exposes
          the Valgrind API to MySQL code. The default is
          <code class="literal">OFF</code>.
        </p><p>
          To generate a Valgrind-aware debug build,
          <a class="link" href="installing.html#option_cmake_with_valgrind"><code class="option">-DWITH_VALGRIND=1</code></a> normally is
          combined with <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">-DWITH_DEBUG=1</code></a>.
          See
          <a class="ulink" href="http://dev.mysql.com/doc/internals/en/debug-configurations.html" target="_top">Building
          Debug Configurations</a>.
        </p></li><li class="listitem"><p><a name="option_cmake_with_zlib"></a>
          <a class="indexterm" name="idm139899654859920"></a>

          <a class="indexterm" name="idm139899654858464"></a>

          <code class="literal">-DWITH_ZLIB=<em class="replaceable"><code>zlib_type</code></em></code>
        </p><p>
          Some features require that the server be built with
          compression library support, such as the
          <a class="link" href="functions.html#function_compress"><code class="literal">COMPRESS()</code></a> and
          <a class="link" href="functions.html#function_uncompress"><code class="literal">UNCOMPRESS()</code></a> functions, and
          compression of the client/server protocol. The
          <a class="link" href="installing.html#option_cmake_with_zlib"><code class="option">WITH_ZLIB</code></a> indicates the source
          of <code class="literal">zlib</code> support:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">bundled</code>: Use the
              <code class="literal">zlib</code> library bundled with the
              distribution. This is the default.
            </p></li><li class="listitem"><p>
              <code class="literal">system</code>: Use the system
              <code class="literal">zlib</code> library. If
              <a class="link" href="installing.html#option_cmake_with_zlib"><code class="option">WITH_ZLIB</code></a> is set to this
              value, the <a class="link" href="programs.html#zlib-decompress" title="4.8.4 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a> utility is
              not built. In this case, the system <span class="command"><strong>openssl
              zlib</strong></span> command can be used instead.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_cmake_without_server"></a>
          <a class="indexterm" name="idm139899654841664"></a>

          <a class="indexterm" name="idm139899654840176"></a>

          <code class="literal">-DWITHOUT_SERVER=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to build without the MySQL server. The default is
          <code class="literal">OFF</code>, which does build the server.
</p></li></ul>
</div>
<h4><a name="cmake-compiler-flags"></a>Compiler Flags</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_cmake_cmake_c_flags"></a>
          <a class="indexterm" name="idm139899654833792"></a>

          <a class="indexterm" name="idm139899654832304"></a>

          <code class="literal">-DCMAKE_C_FLAGS="<em class="replaceable"><code>flags</code></em></code>"
        </p><p>
          Flags for the C Compiler.
        </p></li><li class="listitem"><p><a name="option_cmake_cmake_cxx_flags"></a>
          <a class="indexterm" name="idm139899654828128"></a>

          <a class="indexterm" name="idm139899654826640"></a>

          <code class="literal">-DCMAKE_CXX_FLAGS="<em class="replaceable"><code>flags</code></em></code>"
        </p><p>
          Flags for the C++ Compiler.
        </p></li><li class="listitem"><p><a name="option_cmake_with_default_compiler_options"></a>
          <a class="indexterm" name="idm139899654822432"></a>

          <a class="indexterm" name="idm139899654820976"></a>

          <code class="literal">-DWITH_DEFAULT_COMPILER_OPTIONS=<em class="replaceable"><code>bool</code></em></code>
        </p><p>
          Whether to use the flags from
          <code class="filename">cmake/build_configurations/compiler_options.cmake</code>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            All optimization flags were carefully chosen and tested by
            the MySQL build team. Overriding them can lead to unexpected
            results and is done at your own risk.
</p>
</div>
</li></ul>
</div>
<p>
      To specify your own C and C++ compiler flags, for flags that do
      not affect optimization, use the
      <a class="link" href="installing.html#option_cmake_cmake_c_flags"><code class="option">CMAKE_C_FLAGS</code></a> and
      <a class="link" href="installing.html#option_cmake_cmake_cxx_flags"><code class="option">CMAKE_CXX_FLAGS</code></a> CMake options.
    </p><p>
      When providing your own compiler flags, you might want to specify
      <a class="link" href="installing.html#option_cmake_cmake_build_type"><code class="option">CMAKE_BUILD_TYPE</code></a> as well.
    </p><p>
      For example, to create a 32-bit release build on a 64-bit Linux
      machine, do this:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mkdir bld</code></strong>
shell&gt; <strong class="userinput"><code>cd bld</code></strong>
shell&gt; <strong class="userinput"><code>cmake .. -DCMAKE_C_FLAGS=-m32 \</code></strong>
         <strong class="userinput"><code>-DCMAKE_CXX_FLAGS=-m32 \</code></strong>
         <strong class="userinput"><code>-DCMAKE_BUILD_TYPE=RelWithDebInfo</code></strong>
</pre><p>
      If you set flags that affect optimization
      (<code class="option">-O<em class="replaceable"><code>number</code></em></code>), you must
      set the
      <code class="option">CMAKE_C_FLAGS_<em class="replaceable"><code>build_type</code></em></code>
      and/or
      <code class="option">CMAKE_CXX_FLAGS_<em class="replaceable"><code>build_type</code></em></code>
      options, where <em class="replaceable"><code>build_type</code></em> corresponds
      to the <a class="link" href="installing.html#option_cmake_cmake_build_type"><code class="option">CMAKE_BUILD_TYPE</code></a> value. To
      specify a different optimization for the default build type
      (<code class="literal">RelWithDebInfo</code>) set the
      <code class="option">CMAKE_C_FLAGS_RELWITHDEBINFO</code> and
      <code class="option">CMAKE_CXX_FLAGS_RELWITHDEBINFO</code> options. For
      example, to compile on Linux with <code class="option">-O3</code> and with
      debug symbols, do this:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cmake .. -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g" \</code></strong>
         <strong class="userinput"><code>-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g"</code></strong>
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="compilation-problems"></a>2.9.5 Dealing with Problems Compiling MySQL</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899654796880"></a><a class="indexterm" name="idm139899654795424"></a><a class="indexterm" name="idm139899654793936"></a><a class="indexterm" name="idm139899654792864"></a><a class="indexterm" name="idm139899654791792"></a><p>
      The solution to many problems involves reconfiguring. If you do
      reconfigure, take note of the following:
</p><a class="indexterm" name="idm139899654789776"></a><a class="indexterm" name="idm139899654788688"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If <span class="command"><strong>CMake</strong></span> is run after it has previously
          been run, it may use information that was gathered during its
          previous invocation. This information is stored in
          <code class="filename">CMakeCache.txt</code>. When
          <span class="command"><strong>CMake</strong></span> starts up, it looks for that file and
          reads its contents if it exists, on the assumption that the
          information is still correct. That assumption is invalid when
          you reconfigure.
        </p></li><li class="listitem"><p>
          Each time you run <span class="command"><strong>CMake</strong></span>, you must run
          <span class="command"><strong>make</strong></span> again to recompile. However, you may
          want to remove old object files from previous builds first
          because they were compiled using different configuration
          options.
</p></li></ul>
</div>
<p>
      To prevent old object files or configuration information from
      being used, run the following commands before re-running
      <span class="command"><strong>CMake</strong></span>:
    </p><p>
      On Unix:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>make clean</code></strong>
shell&gt; <strong class="userinput"><code>rm CMakeCache.txt</code></strong>
</pre><p>
      On Windows:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>devenv MySQL.sln /clean</code></strong>
shell&gt; <strong class="userinput"><code>del CMakeCache.txt</code></strong>
</pre><p>
      If you build outside of the source tree, remove and recreate your
      build directory before re-running <span class="command"><strong>CMake</strong></span>. For
      instructions on building outside of the source tree, see
      <a class="ulink" href="http://dev.mysql.com/doc/internals/en/cmake.html" target="_top">How to Build MySQL
      Server with CMake</a>.
    </p><p>
      On some systems, warnings may occur due to differences in system
      include files. The following list describes other problems that
      have been found to occur most often when compiling MySQL:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="indexterm" name="idm139899654770720"></a>

          <a class="indexterm" name="idm139899654769648"></a>

          <a class="indexterm" name="idm139899654768192"></a>

          <a class="indexterm" name="idm139899654767104"></a>

          To define which C and C++ compilers to use, you can define the
          <code class="literal">CC</code> and <code class="literal">CXX</code> environment
          variables. For example:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>CC=gcc</code></strong>
shell&gt; <strong class="userinput"><code>CXX=g++</code></strong>
shell&gt; <strong class="userinput"><code>export CC CXX</code></strong>
</pre><p>
          To specify your own C and C++ compiler flags, use the
          <a class="link" href="installing.html#option_cmake_cmake_c_flags"><code class="option">CMAKE_C_FLAGS</code></a> and
          <a class="link" href="installing.html#option_cmake_cmake_cxx_flags"><code class="option">CMAKE_CXX_FLAGS</code></a> CMake options.
          See <a class="xref" href="installing.html#cmake-compiler-flags" title="Compiler Flags">Compiler Flags</a>.
        </p><p>
          To see what flags you might need to specify, invoke
          <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> with the
          <a class="link" href="programs.html#option_mysql_config_cflags"><code class="option">--cflags</code></a> and
          <a class="link" href="programs.html#option_mysql_config_cxxflags"><code class="option">--cxxflags</code></a> options.
        </p></li><li class="listitem"><p>
          To see what commands are executed during the compile stage,
          after using <span class="command"><strong>CMake</strong></span> to configure MySQL, run
          <span class="command"><strong>make VERBOSE=1</strong></span> rather than just
          <span class="command"><strong>make</strong></span>.
        </p></li><li class="listitem"><p>
          If compilation fails, check whether the
          <a class="link" href="installing.html#option_cmake_mysql_maintainer_mode"><code class="option">MYSQL_MAINTAINER_MODE</code></a> option is
          enabled. This mode causes compiler warnings to become errors,
          so disabling it may enable compilation to proceed.
        </p></li><li class="listitem"><p>
          If your compile fails with errors such as any of the
          following, you must upgrade your version of
          <span class="command"><strong>make</strong></span> to GNU <span class="command"><strong>make</strong></span>:
        </p><pre data-lang="simple" class="programlisting">
make: Fatal error in reader: Makefile, line 18:
Badly formed macro assignment
</pre><p>
          Or:
        </p><pre data-lang="simple" class="programlisting">
make: file `Makefile' line 18: Must be a separator (:
</pre><p>
          Or:
        </p><pre data-lang="simple" class="programlisting">
pthread.h: No such file or directory
</pre><a class="indexterm" name="idm139899654742512"></a><a class="indexterm" name="idm139899654741440"></a><p>
          Solaris and FreeBSD are known to have troublesome
          <span class="command"><strong>make</strong></span> programs.
        </p><p>
          GNU <span class="command"><strong>make</strong></span> 3.75 is known to work.
        </p></li><li class="listitem"><p>
          The <code class="filename">sql_yacc.cc</code> file is generated from
          <code class="filename">sql_yacc.yy</code>. Normally, the build process
          does not need to create <code class="filename">sql_yacc.cc</code>
          because MySQL comes with a pregenerated copy. However, if you
          do need to re-create it, you might encounter this error:
        </p><pre data-lang="simple" class="programlisting">
"sql_yacc.yy", line <em class="replaceable"><code>xxx</code></em> fatal: default action causes potential...
</pre><p>
          This is a sign that your version of <span class="command"><strong>yacc</strong></span> is
          deficient. You probably need to install a recent version of
          <span class="command"><strong>bison</strong></span> (the GNU version of
          <span class="command"><strong>yacc</strong></span>) and use that instead.
        </p><p>
          Versions of <span class="command"><strong>bison</strong></span> older than 1.75 may
          report this error:
        </p><pre data-lang="simple" class="programlisting">
sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded
</pre><p>
          The maximum table size is not actually exceeded; the error is
          caused by bugs in older versions of <span class="command"><strong>bison</strong></span>.
</p></li></ul>
</div>
<p>
      For information about acquiring or updating tools, see the system
      requirements in <a class="xref" href="installing.html#source-installation" title="2.9 Installing MySQL from Source">Section 2.9, “Installing MySQL from Source”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="source-configuration-third-party"></a>2.9.6 MySQL Configuration and Third-Party Tools</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899654724528"></a><a class="indexterm" name="idm139899654723040"></a><p>
      Third-party tools that need to determine the MySQL version from
      the MySQL source can read the <code class="filename">VERSION</code> file in
      the top-level source directory. The file lists the pieces of the
      version separately. For example, if the version is MySQL 8.0.4-rc,
      the file looks like this:
    </p><pre data-lang="simple" class="programlisting">
MYSQL_VERSION_MAJOR=8
MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=4
MYSQL_VERSION_EXTRA=-rc
</pre><p>
      If the source is not for a General Availablility (GA) release, the
      <code class="literal">MYSQL_VERSION_EXTRA</code> value will be nonempty. For
      the example, the value corresponds to Release Candidate.
    </p><p>
      To construct a five-digit number from the version components, use
      this formula:
    </p><pre data-lang="simple" class="programlisting">
MYSQL_VERSION_MAJOR*10000 + MYSQL_VERSION_MINOR*100 + MYSQL_VERSION_PATCH
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="source-installation-doxygen"></a>2.9.7 Generating MySQL Doxygen Documentation Content</h3>

</div>

</div>

</div>
<p>
      The MySQL source code contains internal documentation written
      using Doxygen. The generated Doxygen content is available at
      <a class="ulink" href="http://dev.mysql.com/doc/dev/mysql-server/latest/" target="_top">http://dev.mysql.com/doc/dev/mysql-server/latest/</a>. It is also
      possible to generate this content locally from a MySQL source
      distribution using the following procedure:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Install <span class="command"><strong>doxygen</strong></span> 1.8.11 or higher.
          Distributions are available here:
        </p><pre data-lang="simple" class="programlisting">
<a class="ulink" href="http://www.stack.nl/~dimitri/doxygen/download.html" target="_top">http://www.stack.nl/~dimitri/doxygen/download.html</a>
</pre><p>
          After installing <span class="command"><strong>doxygen</strong></span>, verify the
          version number:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>doxygen --version</code></strong>
1.8.11
</pre></li><li class="listitem"><p>
          Install PlantUML. Distributions are available here:
        </p><pre data-lang="simple" class="programlisting">
<a class="ulink" href="http://plantuml.com/download.html" target="_top">http://plantuml.com/download.html</a>
</pre><p>
          When you install PlantUML on Windows (tested on Windows 10),
          you must run it at least once as administrator so it creates
          the registry keys. Open an administrator console and run this
          command:
        </p><pre data-lang="terminal" class="programlisting">
java -jar <em class="replaceable"><code>path-to-plantuml.jar</code></em>
</pre><p>
          The command should open a GUI window and return no errors on
          the console.
        </p></li><li class="listitem"><p>
          Install the Graphviz <span class="command"><strong>dot</strong></span> command.
          Distributions are available here:
        </p><pre data-lang="simple" class="programlisting">
<a class="ulink" href="http://www.graphviz.org/" target="_top">http://www.graphviz.org/</a>
</pre><p>
          After installing Graphviz, verify <code class="literal">dot</code>
          availability. For example:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>which dot</code></strong>
/usr/bin/dot
shell&gt; <strong class="userinput"><code>dot -V</code></strong>
dot - graphviz version 2.28.0 (20130928.0220)
</pre></li><li class="listitem"><p>
          Set the <code class="literal">PLANTUML_JAR_PATH</code> environment to
          the location where you installed PlantUML. For example:
        </p><pre data-lang="terminal" class="programlisting">
export PLANTUML_JAR_PATH=<em class="replaceable"><code>path-to-plantuml.jar</code></em>
</pre></li><li class="listitem"><p>
          To invoke <span class="command"><strong>doxygen</strong></span>, change location to the
          top-level directory of your MySQL source distribution and
          execute these commands:
        </p><pre data-lang="terminal" class="programlisting">
mkdir -p generated/doxygen
doxygen
</pre><p>
          Inspect the error log. It is available in the
          <code class="filename">doxyerror.log</code> file in the top-level
          directory. Assuming that the build executed successfully, view
          the generated output using a browser. For example:
        </p><pre data-lang="terminal" class="programlisting">
firefox generated/doxygen/html/index.html
</pre><p>
          You can use a different browser, and even bookmark the page.
</p></li></ol>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="postinstallation"></a>2.10 Postinstallation Setup and Testing</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#data-directory-initialization">2.10.1 Initializing the Data Directory</a></span></dt><dt><span class="section"><a href="installing.html#starting-server">2.10.2 Starting the Server</a></span></dt><dt><span class="section"><a href="installing.html#testing-server">2.10.3 Testing the Server</a></span></dt><dt><span class="section"><a href="installing.html#default-privileges">2.10.4 Securing the Initial MySQL Account</a></span></dt><dt><span class="section"><a href="installing.html#automatic-start">2.10.5 Starting and Stopping MySQL Automatically</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899654685728"></a><a class="indexterm" name="idm139899654684272"></a><a class="indexterm" name="idm139899654682784"></a><p>
    This section discusses tasks that you should perform after
    installing MySQL:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        If necessary, initialize the data directory and create the MySQL
        grant tables. For some MySQL installation methods, data
        directory initialization may be done for you automatically:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
            Windows installation operations performed by MySQL Installer.
          </p></li><li class="listitem"><p>
            Installation on Linux using a server RPM or Debian
            distribution from Oracle.
          </p></li><li class="listitem"><p>
            Installation using the native packaging system on many
            platforms, including Debian Linux, Ubuntu Linux, Gentoo
            Linux, and others.
          </p></li><li class="listitem"><p>
            Installation on OS X using a DMG distribution.
</p></li></ul>
</div>
<p>
        For other platforms and installation types, including
        installation from generic binary and source distributions, you
        must initialize the data directory yourself. For instructions,
        see <a class="xref" href="installing.html#data-directory-initialization" title="2.10.1 Initializing the Data Directory">Section 2.10.1, “Initializing the Data Directory”</a>.
      </p></li><li class="listitem"><p>
        Start the server and make sure that it can be accessed. For
        instructions, see <a class="xref" href="installing.html#starting-server" title="2.10.2 Starting the Server">Section 2.10.2, “Starting the Server”</a>, and
        <a class="xref" href="installing.html#testing-server" title="2.10.3 Testing the Server">Section 2.10.3, “Testing the Server”</a>.
      </p></li><li class="listitem"><p>
        Assign passwords to the initial <code class="literal">root</code> account
        in the grant tables, if that was not already done during data
        directory initialization. Passwords prevent unauthorized access
        to the MySQL server. For instructions, see
        <a class="xref" href="installing.html#default-privileges" title="2.10.4 Securing the Initial MySQL Account">Section 2.10.4, “Securing the Initial MySQL Account”</a>.
      </p></li><li class="listitem"><p>
        Optionally, arrange for the server to start and stop
        automatically when your system starts and stops. For
        instructions, see <a class="xref" href="installing.html#automatic-start" title="2.10.5 Starting and Stopping MySQL Automatically">Section 2.10.5, “Starting and Stopping MySQL Automatically”</a>.
      </p></li><li class="listitem"><p>
        Optionally, populate time zone tables to enable recognition of
        named time zones. For instructions, see
        <a class="xref" href="server-administration.html#time-zone-support" title="5.1.10 MySQL Server Time Zone Support">Section 5.1.10, “MySQL Server Time Zone Support”</a>.
</p></li></ul>
</div>
<p>
    When you are ready to create additional user accounts, you can find
    information on the MySQL access control system and account
    management in <a class="xref" href="security.html#privilege-system" title="6.2 The MySQL Access Privilege System">Section 6.2, “The MySQL Access Privilege System”</a>, and
    <a class="xref" href="security.html#user-account-management" title="6.3 MySQL User Account Management">Section 6.3, “MySQL User Account Management”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="data-directory-initialization"></a>2.10.1 Initializing the Data Directory</h3>

</div>

</div>

</div>

<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#data-directory-initialization-mysqld">2.10.1.1 Initializing the Data Directory Manually Using mysqld</a></span></dt></dl>
</div>
<p>
      After installing MySQL, the data directory, including the tables
      in the <code class="literal">mysql</code> system database, must be
      initialized. For some MySQL installation methods, data directory
      initialization can be done automatically, as described in
      <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>. For other installation
      methods, including installation from generic binary and source
      distributions, you must initialize the data directory yourself.
    </p><p>
      This section describes how to initialize the data directory on
      Unix and Unix-like systems. (For Windows, see
      <a class="xref" href="installing.html#windows-postinstallation" title="2.3.7 Windows Postinstallation Procedures">Section 2.3.7, “Windows Postinstallation Procedures”</a>.) For some suggested
      commands that you can use to test whether the server is accessible
      and working properly, see <a class="xref" href="installing.html#testing-server" title="2.10.3 Testing the Server">Section 2.10.3, “Testing the Server”</a>.
    </p><p>
      In the examples shown here, the server is going to run under the
      user ID of the <code class="literal">mysql</code> login account. This
      assumes that such an account exists. Either create the account if
      it does not exist, or substitute the name of a different existing
      login account that you plan to use for running the server. For
      information about creating the account, see
      <a class="link" href="installing.html#binary-installation-createsysuser" title="Create a mysql User and Group">Creating a
      <code class="literal">mysql</code> System User and Group</a>, in
      <a class="xref" href="installing.html#binary-installation" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”</a>.
</p><a class="indexterm" name="idm139899654654320"></a><a class="indexterm" name="idm139899654652832"></a><a class="indexterm" name="idm139899654651344"></a>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Change location into the top-level directory of your MySQL
          installation directory, which is typically
          <code class="filename">/usr/local/mysql</code>:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cd /usr/local/mysql</code></strong>
</pre><p>
          You will find several files and subdirectories inside the
          folder, including the <code class="filename">bin</code> subdirectory,
          which contains the server as well as the client and utility
          programs.
        </p></li><li class="listitem"><p>
          Create a directory whose location can be provided to the
          <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a> system
          variable, which limits import/export operations to that
          specific directory:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mkdir mysql-files</code></strong></pre><p>
          Grant ownership of the directory to the
          <code class="literal">mysql</code> user and group ownership to the
          <code class="literal">mysql</code> group, and set the right permissions
          for the directory:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>chown mysql:mysql mysql-files</code></strong>
shell&gt; <strong class="userinput"><code>chmod 750 mysql-files</code></strong>
</pre></li><li class="listitem"><p>
          Initialize the data directory, including the
          <code class="literal">mysql</code> database containing the initial MySQL
          grant tables that determine how users are permitted to connect
          to the server.
        </p><p>
          Typically, data directory initialization need be done only
          after you first installed MySQL. If you are upgrading an
          existing installation, you should run
          <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> instead (see
          <a class="xref" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables">Section 4.4.5, “<span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables”</a>). However, the command that
          initializes the data directory does not overwrite any existing
          privilege tables, so it should be safe to run in any
          circumstances. Use the server to initialize the data
          directory; for example:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqld --initialize --user=mysql</code></strong>
</pre><p>
          See <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a> for
          some important information on the command, especially on the
          command options you might use.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Initialization of the data directory might fail because some
            required software libraries are missing from your system.
            For example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>bin/mysqld --initialize --user=mysql</code></strong>
bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot
open shared object file: No such file or directory </pre><p>
            When this happens, you have to install the missing libraries
            manually or with your system's package manager before
            retrying the data directory initialization.
</p>
</div>
</li><li class="listitem"><p>
          If you want the server to be able to deploy with automatic
          support for secure connections, use the
          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> utility to create
          default SSL and RSA files:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysql_ssl_rsa_setup</code></strong>
</pre><p>
          For more information, see
          <a class="xref" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files">Section 4.4.3, “<span class="command"><strong>mysql_ssl_rsa_setup</strong></span> — Create SSL/RSA Files”</a>.
        </p></li><li class="listitem"><p>
          If the plugin directory (the directory named by the
          <a class="link" href="server-administration.html#sysvar_plugin_dir"><code class="literal">plugin_dir</code></a> system variable)
          is writable by the server, it may be possible for a user to
          write executable code to a file in the directory using
          <a class="link" href="sql-syntax.html#select-into" title="13.2.10.1 SELECT ... INTO Syntax"><code class="literal">SELECT ... INTO
          DUMPFILE</code></a>. This can be prevented by making the plugin
          directory read only to the server or by setting the
          <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a> system
          variable at server startup to a directory where
          <a class="link" href="sql-syntax.html#select" title="13.2.10 SELECT Syntax"><code class="literal">SELECT</code></a> writes can be performed
          safely. (For example, set it to the
          <code class="filename">mysql-files</code> directory created earlier.)
        </p></li><li class="listitem"><p>
          To specify options that the MySQL server should use at
          startup, put them in a <code class="filename">/etc/my.cnf</code> or
          <code class="filename">/etc/mysql/my.cnf</code> file. You can use such
          a file to set, for example, the
          <a class="link" href="server-administration.html#sysvar_secure_file_priv"><code class="literal">secure_file_priv</code></a> system
          variable. See <a class="xref" href="server-administration.html#server-configuration-defaults" title="5.1.2 Server Configuration Defaults">Section 5.1.2, “Server Configuration Defaults”</a>.
          If you do not do this, the server starts with its default
          settings.
        </p></li><li class="listitem"><p>
          If you want MySQL to start automatically when you boot your
          machine, see <a class="xref" href="installing.html#automatic-start" title="2.10.5 Starting and Stopping MySQL Automatically">Section 2.10.5, “Starting and Stopping MySQL Automatically”</a>.
</p></li></ol>
</div>
<p>
      Data directory initialization creates time zone tables in the
      <code class="literal">mysql</code> database but does not populate them. To
      do so, use the instructions in
      <a class="xref" href="server-administration.html#time-zone-support" title="5.1.10 MySQL Server Time Zone Support">Section 5.1.10, “MySQL Server Time Zone Support”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="data-directory-initialization-mysqld"></a>2.10.1.1 Initializing the Data Directory Manually Using mysqld</h4>
</div>
</div>
</div>
<p>
        This section describes how to initialize the data directory
        using <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, the MySQL server.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          In MySQL 8.0, the default authentication plugin has changed
          from <code class="literal">mysql_native_password</code> to
          <code class="literal">caching_sha2_password</code>, and the
          <code class="literal">'root'@'localhost'</code> administrative account
          uses <code class="literal">caching_sha2_password</code> by default. If
          you prefer that the <code class="literal">root</code> account use the
          previous default authentication plugin
          (<code class="literal">mysql_native_password</code>), see
          <a class="xref" href="installing.html#upgrade-caching-sha2-password-root-account" title="caching_sha2_password and the root Administrative Account">caching_sha2_password and the root Administrative Account</a>.
</p>
</div>
<p>
        The following instructions assume that your current location is
        the MySQL installation directory, represented here by
        <em class="replaceable"><code>BASEDIR</code></em>:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cd <em class="replaceable"><code>BASEDIR</code></em></code></strong>
</pre><p>
        To initialize the data directory, invoke
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with the
        <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
        <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a> option,
        depending on whether you want the server to generate a random
        initial password for the <code class="literal">'root'@'localhost'</code>
        account.
      </p><p>
        On Windows, use one of these commands:
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>bin\mysqld --initialize</code></strong>
C:\&gt; <strong class="userinput"><code>bin\mysqld --initialize-insecure</code></strong>
</pre><p>
        On Unix and Unix-like systems, it is important to make sure that
        the database directories and files are owned by the
        <code class="literal">mysql</code> login account so that the server has
        read and write access to them when you run it later. To ensure
        this, start <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> from the system
        <code class="literal">root</code> account and include the
        <a class="link" href="server-administration.html#option_mysqld_user"><code class="option">--user</code></a> option as shown here:
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqld --initialize --user=mysql</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqld --initialize-insecure --user=mysql</code></strong>
</pre><p>
        Otherwise, execute the program while logged in as
        <code class="literal">mysql</code>, in which case you can omit the
        <a class="link" href="server-administration.html#option_mysqld_user"><code class="option">--user</code></a> option from the command.
      </p><p>
        Regardless of platform, use
        <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> for <span class="quote">“<span class="quote">secure by
        default</span>”</span> installation (that is, including generation of a
        random initial <code class="literal">root</code> password). In this case,
        the password is marked as expired and you will need to choose a
        new one. With the
        <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a> option, no
        <code class="literal">root</code> password is generated; it is assumed
        that you will assign a password to the account in timely fashion
        before putting the server into production use.
      </p><p>
        It might be necessary to specify other options such as
        <a class="link" href="server-administration.html#option_mysqld_basedir"><code class="option">--basedir</code></a> or
        <a class="link" href="server-administration.html#option_mysqld_datadir"><code class="option">--datadir</code></a> if
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> cannot identify the correct locations
        for the installation directory or data directory. For example
        (enter the command on one line):
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqld --initialize --user=mysql</code></strong>
         <strong class="userinput"><code>--basedir=/opt/mysql/mysql</code></strong>
         <strong class="userinput"><code>--datadir=/opt/mysql/mysql/data</code></strong>
</pre><p>
        Alternatively, put the relevant option settings in an option
        file and pass the name of that file to
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. For Unix and Unix-like systems,
        suppose that the option file name is
        <code class="filename">/opt/mysql/mysql/etc/my.cnf</code>. Put these
        lines in the file:
      </p><pre data-lang="ini" class="programlisting">
[mysqld]
basedir=/opt/mysql/mysql
datadir=/opt/mysql/mysql/data
</pre><p>
        Then invoke <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> as follows (enter the
        command on a single line with the
        <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> option first):
      </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqld --defaults-file=/opt/mysql/mysql/etc/my.cnf</code></strong>
         <strong class="userinput"><code>--initialize --user=mysql</code></strong>
</pre><p>
        On Windows, suppose that <code class="literal">C:\my.ini</code> contains
        these lines:
      </p><pre data-lang="ini" class="programlisting">
[mysqld]
basedir=C:\\Program Files\\MySQL\\MySQL Server 8.0
datadir=D:\\MySQLdata
</pre><p>
        Then invoke <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> as follows (the
        <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> option must be
        first):
      </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>bin/mysqld --defaults-file=C:\my.ini --initialize</code></strong>
</pre><p>
        When invoked with the
        <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
        <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a> option,
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> performs the following initialization
        sequence.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The server writes any messages to its standard error output.
          This may be redirected to the error log, so look there if you
          do not see the messages on your screen. For information about
          the error log, including where it is located, see
          <a class="xref" href="server-administration.html#error-log" title="5.4.2 The Error Log">Section 5.4.2, “The Error Log”</a>.
        </p><p>
          On Windows, use the <a class="link" href="server-administration.html#option_mysqld_console"><code class="option">--console</code></a>
          option to direct messages to the console.
</p>
</div>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            The server checks for the existence of the data directory as
            follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                If no data directory exists, the server creates it.
              </p></li><li class="listitem"><p>
                If a data directory exists but is not empty (that is, it
                contains files or subdirectories), the server exits
                after producing an error message:
              </p><pre data-lang="simple" class="programlisting">
[ERROR] --initialize specified but the data directory exists. Aborting.
</pre><p>
                In this case, remove or rename the data directory and
                try again.
              </p><p>
                An existing data directory is permitted to be nonempty
                if every entry has a name that begins with a period
                (<code class="literal">.</code>).
</p></li></ul>
</div>
</li><li class="listitem"><p>
            Within the data directory, the server creates the
            <code class="literal">mysql</code> system database and its tables,
            including the grant tables, server-side help tables, and
            time zone tables. For a complete listing and description of
            the grant tables, see <a class="xref" href="security.html#privilege-system" title="6.2 The MySQL Access Privilege System">Section 6.2, “The MySQL Access Privilege System”</a>.
          </p></li><li class="listitem"><p>
            The server initializes the
            <a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace">system
            tablespace</a> and related data structures needed to
            manage <a class="link" href="innodb-storage-engine.html" title="Chapter 15 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              After <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> sets up the
              <code class="literal">InnoDB</code>
              <a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace">system
              tablespace</a>, changes to some tablespace
              characteristics require setting up a whole new
              <a class="link" href="glossary.html#glos_instance" title="instance">instance</a>. This
              includes the file name of the first file in the system
              tablespace and the number of undo logs. If you do not want
              to use the default values, make sure that the settings for
              the <a class="link" href="innodb-storage-engine.html#sysvar_innodb_data_file_path"><code class="literal">innodb_data_file_path</code></a>
              and <a class="link" href="innodb-storage-engine.html#sysvar_innodb_log_file_size"><code class="literal">innodb_log_file_size</code></a>
              configuration parameters are in place in the MySQL
              <a class="link" href="glossary.html#glos_configuration_file" title="configuration file">configuration
              file</a> before running <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. Also
              make sure to specify as necessary other parameters that
              affect the creation and location of
              <code class="literal">InnoDB</code> files, such as
              <a class="link" href="innodb-storage-engine.html#sysvar_innodb_data_home_dir"><code class="literal">innodb_data_home_dir</code></a> and
              <a class="link" href="innodb-storage-engine.html#sysvar_innodb_log_group_home_dir"><code class="literal">innodb_log_group_home_dir</code></a>.
            </p><p>
              If those options are in your configuration file but that
              file is not in a location that MySQL reads by default,
              specify the file location using the
              <a class="link" href="server-administration.html#option_mysqld_defaults-extra-file"><code class="option">--defaults-extra-file</code></a>
              option when you run <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>.
</p>
</div>
</li><li class="listitem"><p>
            The server creates a <code class="literal">'root'@'localhost'</code>
            superuser account and other reserved accounts (see
            <a class="xref" href="security.html#reserved-users" title="6.3.5 Reserved User Accounts">Section 6.3.5, “Reserved User Accounts”</a>). Some reserved accounts
            are locked and cannot be used by clients, but
            <code class="literal">'root'@'localhost'</code> is intended for
            administrative use and you should assign it a password.
          </p><p>
            The server's action with respect to a password for the
            <code class="literal">'root'@'localhost'</code> account depends on how
            you invoke it:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                With <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> but not
                <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>,
                the server generates a random password, marks it as
                expired, and writes a message displaying the password:
              </p><pre data-lang="simple" class="programlisting">
[Warning] A temporary password is generated for root@localhost:
iTag*AfrH5ej
</pre></li><li class="listitem"><p>
                With
                <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>,
                (either with or without
                <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> because
                <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>
                implies <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a>),
                the server does not generate a password or mark it
                expired, and writes a warning message:
              </p><pre data-lang="simple" class="programlisting">
Warning] root@localhost is created with an empty password ! Please
consider switching off the --initialize-insecure option.
</pre></li></ul>
</div>
<p>
            See later in this section for instructions on assigning a
            new <code class="literal">'root'@'localhost'</code> password.
          </p></li><li class="listitem"><p>
            The server populates the server-side help tables if content
            is available (in the
            <code class="filename">fill_help_tables.sql</code> file). The server
            does not populate the time zone tables; to do so, see
            <a class="xref" href="server-administration.html#time-zone-support" title="5.1.10 MySQL Server Time Zone Support">Section 5.1.10, “MySQL Server Time Zone Support”</a>.
          </p></li><li class="listitem"><p>
            If the <a class="link" href="server-administration.html#option_mysqld_init-file"><code class="option">--init-file</code></a> option was
            given to name a file of SQL statements, the server executes
            the statements in the file. This option enables you to
            perform custom bootstrapping sequences.
          </p><p>
            When the server operates in bootstrap mode, some
            functionality is unavailable that limits the statements
            permitted in the file. These include statements that relate
            to account management (such as <a class="link" href="sql-syntax.html#create-user" title="13.7.1.3 CREATE USER Syntax"><code class="literal">CREATE
            USER</code></a> or <a class="link" href="sql-syntax.html#grant" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a>),
            replication, and global transaction identifiers.
          </p></li><li class="listitem"><p>
            The server exits.
</p></li></ol>
</div>
<p>
        After you initialize the data directory by starting the server
        with <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
        <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>, start the
        server normally (that is, without either of those options) and
        assign the <code class="literal">'root'@'localhost'</code> account a new
        password:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Start the server. For instructions, see
            <a class="xref" href="installing.html#starting-server" title="2.10.2 Starting the Server">Section 2.10.2, “Starting the Server”</a>.
          </p></li><li class="listitem"><p>
            Connect to the server:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                If you used <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a>
                but not
                <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a> to
                initialize the data directory, connect to the server as
                <code class="literal">root</code> using the random password that
                the server generated during the initialization sequence:
              </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -u root -p</code></strong>
Enter password: <em class="replaceable"><code>(enter the random root password here)</code></em>
</pre><p>
                Look in the server error log if you do not know this
                password.
              </p></li><li class="listitem"><p>
                If you used
                <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a> to
                initialize the data directory, connect to the server as
                <code class="literal">root</code> without a password:
              </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -u root --skip-password</code></strong>
</pre></li></ul>
</div>
</li><li class="listitem"><p>
            After connecting, assign a new <code class="literal">root</code>
            password:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY '<em class="replaceable"><code>new_password'</code></em>;</code></strong>
</pre></li></ol>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
          The data directory initialization sequence performed by the
          server does not substitute for the actions performed by
          <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> or
          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a>. See
          <a class="xref" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security">Section 4.4.2, “<span class="command"><strong>mysql_secure_installation</strong></span> — Improve MySQL Installation Security”</a>, and
          <a class="xref" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files">Section 4.4.3, “<span class="command"><strong>mysql_ssl_rsa_setup</strong></span> — Create SSL/RSA Files”</a>.
</p>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="starting-server"></a>2.10.2 Starting the Server</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#starting-server-troubleshooting">2.10.2.1 Troubleshooting Problems Starting the MySQL Server</a></span></dt></dl>
</div>
<p>
      This section describes how start the server on Unix and Unix-like
      systems. (For Windows, see
      <a class="xref" href="installing.html#windows-server-first-start" title="2.3.5.5 Starting the Server for the First Time">Section 2.3.5.5, “Starting the Server for the First Time”</a>.) For some suggested
      commands that you can use to test whether the server is accessible
      and working properly, see <a class="xref" href="installing.html#testing-server" title="2.10.3 Testing the Server">Section 2.10.3, “Testing the Server”</a>.
    </p><p>
      Start the MySQL server like this if your installation includes
      <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqld_safe --user=mysql &amp;</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        For Linux systems on which MySQL is installed using RPM
        packages, server startup and shutdown is managed using systemd
        rather than <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>, and
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is not installed. See
        <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
</p>
</div>
<p>
      Start the server like this if your installation includes systemd
      support:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>systemctl start mysqld</code></strong>
</pre><p>
      Substitute the appropriate service name if it differs from
      <code class="literal">mysqld</code>; for example, <code class="literal">mysql</code>
      on SLES systems.
    </p><p>
      It is important that the MySQL server be run using an unprivileged
      (non-<code class="literal">root</code>) login account. To ensure this, run
      <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> as <code class="literal">root</code> and
      include the <a class="link" href="programs.html#option_mysqld_safe_user"><code class="option">--user</code></a> option as
      shown. Otherwise, you should execute the program while logged in
      as <code class="literal">mysql</code>, in which case you can omit the
      <a class="link" href="programs.html#option_mysqld_safe_user"><code class="option">--user</code></a> option from the
      command.
    </p><p>
      For further instructions for running MySQL as an unprivileged
      user, see <a class="xref" href="security.html#changing-mysql-user" title="6.1.5 How to Run MySQL as a Normal User">Section 6.1.5, “How to Run MySQL as a Normal User”</a>.
    </p><p>
      If the command fails immediately and prints <code class="literal">mysqld
      ended</code>, look for information in the error log (which by
      default is the
      <code class="filename"><em class="replaceable"><code>host_name</code></em>.err</code> file
      in the data directory).
    </p><p>
      If the server is unable to access the data directory it starts or
      read the grant tables in the <code class="literal">mysql</code> database, it
      writes a message to its error log. Such problems can occur if you
      neglected to create the grant tables by initializing the data
      directory before proceeding to this step, or if you ran the
      command that initializes the data directory without the
      <code class="option">--user</code> option. Remove the
      <code class="filename">data</code> directory and run the command with the
      <code class="option">--user</code> option.
    </p><p>
      If you have other problems starting the server, see
      <a class="xref" href="installing.html#starting-server-troubleshooting" title="2.10.2.1 Troubleshooting Problems Starting the MySQL Server">Section 2.10.2.1, “Troubleshooting Problems Starting the MySQL Server”</a>. For more
      information about <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>, see
      <a class="xref" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script">Section 4.3.2, “<span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script”</a>. For more information about systemd
      support, see <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="starting-server-troubleshooting"></a>2.10.2.1 Troubleshooting Problems Starting the MySQL Server</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899654431248"></a><a class="indexterm" name="idm139899654429760"></a><a class="indexterm" name="idm139899654428272"></a><a class="indexterm" name="idm139899654426784"></a><p>
        This section provides troubleshooting suggestions for problems
        starting the server. For additional suggestions for Windows
        systems, see <a class="xref" href="installing.html#windows-troubleshooting" title="2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation">Section 2.3.6, “Troubleshooting a Microsoft Windows MySQL Server Installation”</a>.
      </p><p>
        If you have problems starting the server, here are some things
        to try:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Check the <a class="link" href="glossary.html#glos_error_log" title="error log">error log</a> to
            see why the server does not start. Log files are located in
            the <a class="link" href="glossary.html#glos_data_directory" title="data directory">data
            directory</a> (typically <code class="filename">C:\Program
            Files\MySQL\MySQL Server 8.0\data</code> on
            Windows, <code class="filename">/usr/local/mysql/data</code> for a
            Unix/Linux binary distribution, and
            <code class="filename">/usr/local/var</code> for a Unix/Linux source
            distribution). Look in the data directory for files with
            names of the form
            <code class="filename"><em class="replaceable"><code>host_name</code></em>.err</code>
            and
            <code class="filename"><em class="replaceable"><code>host_name</code></em>.log</code>,
            where <em class="replaceable"><code>host_name</code></em> is the name of
            your server host. Then examine the last few lines of these
            files. Use <code class="literal">tail</code> to display them:
          </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>tail <em class="replaceable"><code>host_name</code></em>.err</code></strong>
shell&gt; <strong class="userinput"><code>tail <em class="replaceable"><code>host_name</code></em>.log</code></strong>
</pre></li><li class="listitem"><p>
            Specify any special options needed by the storage engines
            you are using. You can create a <code class="filename">my.cnf</code>
            file and specify startup options for the engines that you
            plan to use. If you are going to use storage engines that
            support transactional tables (<code class="literal">InnoDB</code>,
            <a class="ulink" href="http://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html" target="_top"><code class="literal">NDB</code></a>), be sure that you have
            them configured the way you want before starting the server.
            If you are using <code class="literal">InnoDB</code> tables, see
            <a class="xref" href="innodb-storage-engine.html#innodb-configuration" title="15.6 InnoDB Configuration">Section 15.6, “InnoDB Configuration”</a> for guidelines and
            <a class="xref" href="innodb-storage-engine.html#innodb-parameters" title="15.13 InnoDB Startup Options and System Variables">Section 15.13, “InnoDB Startup Options and System Variables”</a> for option syntax.
          </p><p>
            Although storage engines use default values for options that
            you omit, Oracle recommends that you review the available
            options and specify explicit values for any options whose
            defaults are not appropriate for your installation.
          </p></li><li class="listitem"><p>
            Make sure that the server knows where to find the
            <a class="link" href="glossary.html#glos_data_directory" title="data directory">data directory</a>.
            The <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server uses this directory as
            its current directory. This is where it expects to find
            databases and where it expects to write log files. The
            server also writes the pid (process ID) file in the data
            directory.
          </p><p>
            The default data directory location is hardcoded when the
            server is compiled. To determine what the default path
            settings are, invoke <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with the
            <a class="link" href="server-administration.html#option_mysqld_verbose"><code class="option">--verbose</code></a> and
            <a class="link" href="server-administration.html#option_mysqld_help"><code class="option">--help</code></a> options. If the data
            directory is located somewhere else on your system, specify
            that location with the
            <a class="link" href="server-administration.html#option_mysqld_datadir"><code class="option">--datadir</code></a> option to
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> or <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>,
            on the command line or in an option file. Otherwise, the
            server will not work properly. As an alternative to the
            <a class="link" href="server-administration.html#option_mysqld_datadir"><code class="option">--datadir</code></a> option, you can
            specify <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> the location of the base
            directory under which MySQL is installed with the
            <a class="link" href="server-administration.html#option_mysqld_basedir"><code class="option">--basedir</code></a>, and
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> looks for the
            <code class="filename">data</code> directory there.
          </p><p>
            To check the effect of specifying path options, invoke
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with those options followed by the
            <a class="link" href="server-administration.html#option_mysqld_verbose"><code class="option">--verbose</code></a> and
            <a class="link" href="server-administration.html#option_mysqld_help"><code class="option">--help</code></a> options. For example,
            if you change location into the directory where
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is installed and then run the
            following command, it shows the effect of starting the
            server with a base directory of
            <code class="filename">/usr/local</code>:
          </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>./mysqld --basedir=/usr/local --verbose --help</code></strong>
</pre><p>
            You can specify other options such as
            <a class="link" href="server-administration.html#option_mysqld_datadir"><code class="option">--datadir</code></a> as well, but
            <a class="link" href="server-administration.html#option_mysqld_verbose"><code class="option">--verbose</code></a> and
            <a class="link" href="server-administration.html#option_mysqld_help"><code class="option">--help</code></a> must be the last
            options.
          </p><p>
            Once you determine the path settings you want, start the
            server without <a class="link" href="server-administration.html#option_mysqld_verbose"><code class="option">--verbose</code></a> and
            <a class="link" href="server-administration.html#option_mysqld_help"><code class="option">--help</code></a>.
          </p><p>
            If <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is currently running, you can
            find out what path settings it is using by executing this
            command:
          </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysqladmin variables</code></strong>
</pre><p>
            Or:
          </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysqladmin -h <em class="replaceable"><code>host_name</code></em> variables</code></strong>
</pre><p>
            <em class="replaceable"><code>host_name</code></em> is the name of the
            MySQL server host.
          </p></li><li class="listitem"><p>
            Make sure that the server can access the
            <a class="link" href="glossary.html#glos_data_directory" title="data directory">data directory</a>.
            The ownership and permissions of the data directory and its
            contents must allow the server to read and modify them.
          </p><p>
            If you get <code class="literal">Errcode 13</code> (which means
            <code class="literal">Permission denied</code>) when starting
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, this means that the privileges of
            the data directory or its contents do not permit server
            access. In this case, you change the permissions for the
            involved files and directories so that the server has the
            right to use them. You can also start the server as
            <code class="literal">root</code>, but this raises security issues and
            should be avoided.
          </p><p>
            Change location into the data directory and check the
            ownership of the data directory and its contents to make
            sure the server has access. For example, if the data
            directory is <code class="filename">/usr/local/mysql/var</code>, use
            this command:
          </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>ls -la /usr/local/mysql/var</code></strong>
</pre><p>
            If the data directory or its files or subdirectories are not
            owned by the login account that you use for running the
            server, change their ownership to that account. If the
            account is named <code class="literal">mysql</code>, use these
            commands:
          </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>chown -R mysql /usr/local/mysql/var</code></strong>
shell&gt; <strong class="userinput"><code>chgrp -R mysql /usr/local/mysql/var</code></strong>
</pre><p>
            Even with correct ownership, MySQL might fail to start up if
            there is other security software running on your system that
            manages application access to various parts of the file
            system. In this case, reconfigure that software to enable
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to access the directories it uses
            during normal operation.
          </p></li><li class="listitem"><p>
            Verify that the network interfaces the server wants to use
            are available.
          </p><p>
            If either of the following errors occur, it means that some
            other program (perhaps another <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            server) is using the TCP/IP port or Unix socket file that
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is trying to use:
          </p><pre data-lang="simple" class="programlisting">
Can't start server: Bind on TCP/IP port: Address already in use
Can't start server: Bind on unix socket...
</pre><p>
            Use <span class="command"><strong>ps</strong></span> to determine whether you have
            another <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server running. If so,
            shut down the server before starting
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> again. (If another server is
            running, and you really want to run multiple servers, you
            can find information about how to do so in
            <a class="xref" href="server-administration.html#multiple-servers" title="5.7 Running Multiple MySQL Instances on One Machine">Section 5.7, “Running Multiple MySQL Instances on One Machine”</a>.)
          </p><p>
            If no other server is running, execute the command
            <code class="literal">telnet <em class="replaceable"><code>your_host_name</code></em>
            <em class="replaceable"><code>tcp_ip_port_number</code></em></code>.
            (The default MySQL port number is 3306.) Then press Enter a
            couple of times. If you do not get an error message like
            <code class="literal">telnet: Unable to connect to remote host:
            Connection refused</code>, some other program is using
            the TCP/IP port that <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is trying to
            use. Track down what program this is and disable it, or tell
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to listen to a different port with
            the <a class="link" href="server-administration.html#option_mysqld_port"><code class="option">--port</code></a> option. In this
            case, specify the same non-default port number for client
            programs when connecting to the server using TCP/IP.
          </p><p>
            Another reason the port might be inaccessible is that you
            have a firewall running that blocks connections to it. If
            so, modify the firewall settings to permit access to the
            port.
          </p><p>
            If the server starts but you cannot connect to it, make sure
            that you have an entry in <code class="filename">/etc/hosts</code>
            that looks like this:
          </p><pre data-lang="simple" class="programlisting">
127.0.0.1       localhost
</pre></li><li class="listitem"><p>
            If you cannot get <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to start, try to
            make a trace file to find the problem by using the
            <a class="link" href="server-administration.html#option_mysqld_debug"><code class="option">--debug</code></a> option. See
            <a class="xref" href="extending-mysql.html#dbug-package" title="28.5.3 The DBUG Package">Section 28.5.3, “The DBUG Package”</a>.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="testing-server"></a>2.10.3 Testing the Server</h3>

</div>

</div>

</div>
<p>
      After the data directory is initialized and you have started the
      server, perform some simple tests to make sure that it works
      satisfactorily. This section assumes that your current location is
      the MySQL installation directory and that it has a
      <code class="filename">bin</code> subdirectory containing the MySQL
      programs used here. If that is not true, adjust the command path
      names accordingly.
    </p><a class="indexterm" name="idm139899654328736"></a><a class="indexterm" name="idm139899654327648"></a><p>
      Alternatively, add the <code class="filename">bin</code> directory to your
      <code class="literal">PATH</code> environment variable setting. That enables
      your shell (command interpreter) to find MySQL programs properly,
      so that you can run a program by typing only its name, not its
      path name. See <a class="xref" href="programs.html#setting-environment-variables" title="4.2.10 Setting Environment Variables">Section 4.2.10, “Setting Environment Variables”</a>.
    </p><p>
      Use <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> to verify that the server is
      running. The following commands provide simple tests to check
      whether the server is up and responding to connections:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqladmin version</code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqladmin variables</code></strong>
</pre><p>
      If you cannot connect to the server, specify a <code class="option">-u
      root</code> option to connect as <code class="literal">root</code>. If you
      have assigned a password for the <code class="literal">root</code> account
      already, you'll also need to specify <code class="option">-p</code> on the
      command line and enter the password when prompted. For example:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqladmin -u root -p version</code></strong>
Enter password: <em class="replaceable"><code>(enter root password here)</code></em>
</pre><p>
      The output from <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin version</strong></span></a> varies
      slightly depending on your platform and version of MySQL, but
      should be similar to that shown here:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqladmin version</code></strong>
mysqladmin  Ver 14.12 Distrib 8.0.13, for pc-linux-gnu on i686
...

Server version          8.0.13
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 14 days 5 hours 5 min 21 sec

Threads: 1  Questions: 366  Slow queries: 0
Opens: 0  Flush tables: 1  Open tables: 19
Queries per second avg: 0.000
</pre><p>
      To see what else you can do with <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>,
      invoke it with the <a class="link" href="programs.html#option_mysqladmin_help"><code class="option">--help</code></a>
      option.
    </p><a class="indexterm" name="idm139899654307632"></a><a class="indexterm" name="idm139899654306144"></a><p>
      Verify that you can shut down the server (include a
      <code class="option">-p</code> option if the <code class="literal">root</code> account
      has a password already):
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqladmin -u root shutdown</code></strong>
</pre><p>
      Verify that you can start the server again. Do this by using
      <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> or by invoking
      <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> directly. For example:
    </p><a class="indexterm" name="idm139899654298400"></a><a class="indexterm" name="idm139899654296912"></a><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqld_safe --user=mysql &amp;</code></strong>
</pre><p>
      If <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> fails, see
      <a class="xref" href="installing.html#starting-server-troubleshooting" title="2.10.2.1 Troubleshooting Problems Starting the MySQL Server">Section 2.10.2.1, “Troubleshooting Problems Starting the MySQL Server”</a>.
    </p><p>
      Run some simple tests to verify that you can retrieve information
      from the server. The output should be similar to that shown here.
    </p><p>
      Use <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> to see what databases exist:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqlshow</code></strong>
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
</pre><p>
      The list of installed databases may vary, but will always include
      the minimum of <code class="literal">mysql</code> and
      <code class="literal">information_schema</code>.
    </p><p>
      If you specify a database name, <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>
      displays a list of the tables within the database:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysqlshow mysql</code></strong>
Database: mysql
+---------------------------+
|          Tables           |
+---------------------------+
| columns_priv              |
| db                        |
| engine_cost               |
| event                     |
| func                      |
| general_log               |
| gtid_executed             |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| innodb_index_stats        |
| innodb_table_stats        |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| server_cost               |
| servers                   |
| slave_master_info         |
| slave_relay_log_info      |
| slave_worker_info         |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
</pre><p>
      Use the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> program to select information
      from a table in the <code class="literal">mysql</code> database:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>bin/mysql -e "SELECT User, Host, plugin FROM mysql.user" mysql</code></strong>
+------+-----------+-----------------------+
| User | Host      | plugin                |
+------+-----------+-----------------------+
| root | localhost | caching_sha2_password |
+------+-----------+-----------------------+
</pre><p>
      At this point, your server is running and you can access it. To
      tighten security if you have not yet assigned a password to the
      initial account, follow the instructions in
      <a class="xref" href="installing.html#default-privileges" title="2.10.4 Securing the Initial MySQL Account">Section 2.10.4, “Securing the Initial MySQL Account”</a>.
    </p><p>
      For more information about <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a>,
      <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>, and <a class="link" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>,
      see <a class="xref" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool">Section 4.5.1, “<span class="command"><strong>mysql</strong></span> — The MySQL Command-Line Tool”</a>, <a class="xref" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server">Section 4.5.2, “<span class="command"><strong>mysqladmin</strong></span> — Client for Administering a MySQL Server”</a>, and
      <a class="xref" href="programs.html#mysqlshow" title="4.5.8 mysqlshow — Display Database, Table, and Column Information">Section 4.5.8, “<span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="default-privileges"></a>2.10.4 Securing the Initial MySQL Account</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899654267920"></a><a class="indexterm" name="idm139899654266464"></a><a class="indexterm" name="idm139899654264976"></a><a class="indexterm" name="idm139899654263904"></a><a class="indexterm" name="idm139899654262832"></a><a class="indexterm" name="idm139899654261344"></a><a class="indexterm" name="idm139899654260272"></a><a class="indexterm" name="idm139899654258784"></a><a class="indexterm" name="idm139899654257296"></a><a class="indexterm" name="idm139899654255808"></a><a class="indexterm" name="idm139899654254320"></a><a class="indexterm" name="idm139899654252832"></a><a class="indexterm" name="idm139899654251344"></a><a class="indexterm" name="idm139899654249856"></a><a class="indexterm" name="idm139899654248368"></a><a class="indexterm" name="idm139899654246880"></a><a class="indexterm" name="idm139899654245392"></a><a class="indexterm" name="idm139899654243904"></a><a class="indexterm" name="idm139899654242416"></a><a class="indexterm" name="idm139899654240928"></a><p>
      The MySQL installation process involves initializing the data
      directory, including the <code class="literal">mysql</code> database
      containing the grant tables that define MySQL accounts. For
      details, see <a class="xref" href="installing.html#postinstallation" title="2.10 Postinstallation Setup and Testing">Section 2.10, “Postinstallation Setup and Testing”</a>.
    </p><p>
      This section describes how to assign a password to the initial
      <code class="literal">root</code> account created during the MySQL
      installation procedure, if you have not already done so.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        On Windows, you can also perform the process described in this
        section during installation with MySQL Installer (see
        <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>). On all platforms, the MySQL
        distribution includes
        <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a>, a command-line
        utility that automates much of the process of securing a MySQL
        installation. MySQL Workbench is available on all platforms, and
        also offers the ability to manage user accounts (see
        <a class="xref" href="workbench.html" title="Chapter 30 MySQL Workbench">Chapter 30, <i>MySQL Workbench</i></a> ).
</p>
</div>
<p>
      A password may already be assigned to the initial account under
      these circumstances:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          On Windows, installations performed using MySQL Installer give you the
          option of assigning a password.
        </p></li><li class="listitem"><p>
          Installation using the OS X installer generates an initial
          random password, which the installer displays to the user in a
          dialog box.
        </p></li><li class="listitem"><p>
          Installation using RPM packages generates an initial random
          password, which is written to the server error log.
        </p></li><li class="listitem"><p>
          Installations using Debian packages give you the option of
          assigning a password.
        </p></li><li class="listitem"><p>
          For data directory initialization performed manually using
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld --initialize</strong></span></a>,
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> generates an initial random
          password, marks it expired, and writes it to the server error
          log. For details, see
          <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a>.
</p></li></ul>
</div>
<p>
      The <code class="literal">mysql.user</code> grant table defines the initial
      MySQL user account and its access privileges. Installation of
      MySQL creates only a <code class="literal">'root'@'localhost'</code>
      superuser account that has all privileges and can do anything. If
      the <code class="literal">root</code> account has an empty password, your
      MySQL installation is unprotected: Anyone can connect to the MySQL
      server as <code class="literal">root</code> <span class="emphasis"><em>without a
      password</em></span> and be granted all privileges.
    </p><p>
      The <code class="literal">'root'@'localhost'</code> account also has a row
      in the <code class="literal">mysql.proxies_priv</code> table that enables
      granting the <a class="link" href="security.html#priv_proxy"><code class="literal">PROXY</code></a> privilege for
      <code class="literal">''@''</code>, that is, for all users and all hosts.
      This enables <code class="literal">root</code> to set up proxy users, as
      well as to delegate to other accounts the authority to set up
      proxy users. See <a class="xref" href="security.html#proxy-users" title="6.3.11 Proxy Users">Section 6.3.11, “Proxy Users”</a>.
    </p><p>
      To assign a password for the initial MySQL <code class="literal">root</code>
      account, use the following procedure. Replace
      <em class="replaceable"><code>new_password</code></em> in the examples with the
      password that you want to use.
    </p><p>
      Start the server if it is not running. For instructions, see
      <a class="xref" href="installing.html#starting-server" title="2.10.2 Starting the Server">Section 2.10.2, “Starting the Server”</a>.
    </p><p>
      The initial <code class="literal">root</code> account may or may not have a
      password. Choose whichever of the following procedures applies:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If the <code class="literal">root</code> account exists with an initial
          random password that has been expired, connect to the server
          as <code class="literal">root</code> using that password, then choose a
          new password. This is the case if the data directory was
          initialized using <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld --initialize</strong></span></a>,
          either manually or using an installer that does not give you
          the option of specifying a password during the install
          operation. Because the password exists, you must use it to
          connect to the server. But because the password is expired,
          you cannot use the account for any purpose other than to
          choose a new password, until you do choose one.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
              If you do not know the initial random password, look in
              the server error log.
            </p></li><li class="listitem"><p>
              Connect to the server as <code class="literal">root</code> using the
              password:
            </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -u root -p</code></strong>
Enter password: <em class="replaceable"><code>(enter the random root password here)</code></em>
</pre></li><li class="listitem"><p>
              Choose a new password to replace the random password:
            </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY '<em class="replaceable"><code>new_password</code></em>';</code></strong>
</pre></li></ol>
</div>
</li><li class="listitem"><p>
          If the <code class="literal">root</code> account exists but has no
          password, connect to the server as <code class="literal">root</code>
          using no password, then assign a password. This is the case if
          you initialized the data directory using <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld
          --initialize-insecure</strong></span></a>.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
              Connect to the server as <code class="literal">root</code> using no
              password:
            </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -u root --skip-password</code></strong>
</pre></li><li class="listitem"><p>
              Assign a password:
            </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY '<em class="replaceable"><code>new_password</code></em>';</code></strong>
</pre></li></ol>
</div>
</li></ul>
</div>
<p>
      After assigning the <code class="literal">root</code> account a password,
      you must supply that password whenever you connect to the server
      using the account. For example, to connect to the server using the
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client, use this command:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>mysql -u root -p</code></strong>
Enter password: <em class="replaceable"><code>(enter root password here)</code></em>
</pre><p>
      To shut down the server with <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>, use
      this command:
    </p><pre data-lang="sql" class="programlisting">
shell&gt; <strong class="userinput"><code>mysqladmin -u root -p shutdown</code></strong>
Enter password: <em class="replaceable"><code>(enter root password here)</code></em>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        For additional information about setting passwords, see
        <a class="xref" href="security.html#assigning-passwords" title="6.3.7 Assigning Account Passwords">Section 6.3.7, “Assigning Account Passwords”</a>. If you forget your
        <code class="literal">root</code> password after setting it, see
        <a class="xref" href="error-handling.html#resetting-permissions" title="B.5.3.2 How to Reset the Root Password">Section B.5.3.2, “How to Reset the Root Password”</a>.
      </p><p>
        To set up additional accounts, see
        <a class="xref" href="security.html#adding-users" title="6.3.2 Adding User Accounts">Section 6.3.2, “Adding User Accounts”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="automatic-start"></a>2.10.5 Starting and Stopping MySQL Automatically</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899654172064"></a><a class="indexterm" name="idm139899654170592"></a><a class="indexterm" name="idm139899654169104"></a><p>
      This section discusses methods for starting and stopping the MySQL
      server.
    </p><p>
      Generally, you start the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server in one
      of these ways:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Invoke <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> directly. This works on any
          platform.
        </p></li><li class="listitem"><p>
          On Windows, you can set up a MySQL service that runs
          automatically when Windows starts. See
          <a class="xref" href="installing.html#windows-start-service" title="2.3.5.8 Starting MySQL as a Windows Service">Section 2.3.5.8, “Starting MySQL as a Windows Service”</a>.
        </p></li><li class="listitem"><p>
          On Unix and Unix-like systems, you can invoke
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>, which tries to determine the
          proper options for <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> and then runs it
          with those options. See <a class="xref" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script">Section 4.3.2, “<span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script”</a>.
        </p></li><li class="listitem"><p>
          On Linux systems that support systemd, you can use it to
          control the server. See <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
        </p></li><li class="listitem"><p>
          On systems that use System V-style run directories (that is,
          <code class="filename">/etc/init.d</code> and run-level specific
          directories), invoke <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a>. This
          script is used primarily at system startup and shutdown. It
          usually is installed under the name <code class="literal">mysql</code>.
          The <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> script starts the server
          by invoking <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. See
          <a class="xref" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script">Section 4.3.3, “<span class="command"><strong>mysql.server</strong></span> — MySQL Server Startup Script”</a>.
        </p></li><li class="listitem"><p>
          On OS X, install a launchd daemon to enable automatic MySQL
          startup at system startup. The daemon starts the server by
          invoking <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. For details, see
          <a class="xref" href="installing.html#osx-installation-launchd" title="2.4.3 Installing and Using the MySQL Launch Daemon">Section 2.4.3, “Installing and Using the MySQL Launch Daemon”</a>. A MySQL Preference
          Pane also provides control for starting and stopping MySQL
          through the System Preferences. See
          <a class="xref" href="installing.html#osx-installation-prefpane" title="2.4.4 Installing and Using the MySQL Preference Pane">Section 2.4.4, “Installing and Using the MySQL Preference Pane”</a>.
        </p></li><li class="listitem"><p>
          On Solaris, use the service management framework (SMF) system
          to initiate and control MySQL startup.

</p></li></ul>
</div>
<p>
      systemd, the <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> and
      <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> scripts, Solaris SMF, and the OS X
      Startup Item (or MySQL Preference Pane) can be used to start the
      server manually, or automatically at system startup time. systemd,
      <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a>, and the Startup Item also can be
      used to stop the server.
    </p><p>
      The following table shows which option groups the server and
      startup scripts read from option files.
</p>
<div class="table">
<a name="startup-scripts-server-option-groups"></a><p class="title"><b>Table 2.14 MySQL Startup Scripts and Supported Server Option Groups</b></p>
<div class="table-contents">
<table summary="MySQL startup scripts and the server option groups they support."><col width="20%"><col width="80%"><thead><tr>
          <th scope="col">Script</th>
          <th scope="col">Option Groups</th>
        </tr></thead><tbody><tr>
          <td scope="row"><a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a></td>
          <td><code class="literal">[mysqld]</code>, <code class="literal">[server]</code>,
            <code class="literal">[mysqld-<em class="replaceable"><code>major_version</code></em>]</code></td>
        </tr><tr>
          <td scope="row"><a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a></td>
          <td><code class="literal">[mysqld]</code>, <code class="literal">[server]</code>,
            <code class="literal">[mysqld_safe]</code></td>
        </tr><tr>
          <td scope="row"><a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a></td>
          <td><code class="literal">[mysqld]</code>, <code class="literal">[mysql.server]</code>,
            <code class="literal">[server]</code></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <code class="literal">[mysqld-<em class="replaceable"><code>major_version</code></em>]</code>
      means that groups with names like
      <code class="literal">[mysqld-5.7]</code> and
      <code class="literal">[mysqld-8.0]</code> are read by servers
      having versions 5.7.x, 8.0.x, and so
      forth. This feature can be used to specify options that can be
      read only by servers within a given release series.
    </p><p>
      For backward compatibility, <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> also
      reads the <code class="literal">[mysql_server]</code> group and
      <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> also reads the
      <code class="literal">[safe_mysqld]</code> group. To be current, you should
      update your option files to use the
      <code class="literal">[mysql.server]</code> and
      <code class="literal">[mysqld_safe]</code> groups instead.
    </p><p>
      For more information on MySQL configuration files and their
      structure and contents, see <a class="xref" href="programs.html#option-files" title="4.2.6 Using Option Files">Section 4.2.6, “Using Option Files”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="upgrading-downgrading"></a>2.11 Upgrading or Downgrading MySQL</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#upgrading">2.11.1 Upgrading MySQL</a></span></dt><dt><span class="section"><a href="installing.html#downgrading">2.11.2 Downgrading MySQL</a></span></dt><dt><span class="section"><a href="installing.html#rebuilding-tables">2.11.3 Rebuilding or Repairing Tables or Indexes</a></span></dt><dt><span class="section"><a href="installing.html#copying-databases">2.11.4 Copying MySQL Databases to Another Machine</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899654105440"></a><a class="indexterm" name="idm139899654104400"></a><p>
    Upgrading is a common procedure, as you pick up bug fixes within the
    same MySQL release series or significant features between major
    MySQL releases. You perform this procedure first on some test
    systems to make sure everything works smoothly, and then on the
    production systems.
  </p><p>
    Downgrading is less common. It is typically performed because of a
    compatibility or performance issue that occurs on a production
    system that was not uncovered during initial upgrade verification on
    test systems.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      Downgrade from MySQL 8.0 to MySQL 5.7
      (or from a MySQL 8.0 release to a previous MySQL
      8.0 release) is not supported. The only supported
      alternative is to restore a backup taken
      <span class="emphasis"><em>before</em></span> upgrading. It is therefore imperative
      that you backup your data before starting the upgrade process.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="upgrading"></a>2.11.1 Upgrading MySQL</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#upgrading-strategies">2.11.1.1 MySQL Upgrade Strategies</a></span></dt><dt><span class="section"><a href="installing.html#upgrading-from-previous-series">2.11.1.2 Changes Affecting Upgrades to MySQL 8.0</a></span></dt><dt><span class="section"><a href="installing.html#updating-yum-repo">2.11.1.3 Upgrading MySQL with the MySQL Yum Repository</a></span></dt><dt><span class="section"><a href="installing.html#updating-apt-repo">2.11.1.4 Upgrading MySQL with the MySQL APT Repository</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899654099344"></a><p>
      This section describes how to upgrade to a new MySQL version.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="upgrading-strategies"></a>2.11.1.1 MySQL Upgrade Strategies</h4>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#upgrade-methods" title="Upgrade Methods">Upgrade Methods</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-paths" title="Upgrade Paths">Upgrade Paths</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-before-you-begin" title="Before You Begin">Before You Begin</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-prerequisites" title="Verifying Upgrade Prerequisites for Your MySQL 5.7 Installation">Verifying Upgrade Prerequisites for Your MySQL 5.7
Installation</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-procedure-inplace" title="In-Place Upgrade">In-Place Upgrade</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-troubleshooting" title="Upgrade Troubleshooting">Upgrade Troubleshooting</a></p></li></ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-methods"></a>Upgrade Methods</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <span class="emphasis"><em>In-Place Upgrade</em></span>: Involves shutting
              down the old MySQL version, replacing the old MySQL
              binaries or packages with the new ones, restarting MySQL
              on the existing data directory, and running
              <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>. For the in-place upgrade
              procedure, see
              <a class="xref" href="installing.html#upgrade-procedure-inplace" title="In-Place Upgrade">In-Place Upgrade</a>.
            </p><p>
              Logical upgrade using the <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>
              database backup program is not supported.
            </p></li><li class="listitem"><p>
              If you run MySQL Server on Windows, refer to the upgrade
              procedure described in
              <a class="xref" href="installing.html#windows-upgrading" title="2.3.8 Upgrading MySQL on Windows">Section 2.3.8, “Upgrading MySQL on Windows”</a>.
            </p></li><li class="listitem"><p>
              If your current MySQL installation was installed on an
              Enterprise Linux platform or Fedora using the MySQL Yum
              Repository, see <a class="xref" href="installing.html#updating-yum-repo" title="2.11.1.3 Upgrading MySQL with the MySQL Yum Repository">Section 2.11.1.3, “Upgrading MySQL with the MySQL Yum Repository”</a>.
            </p></li><li class="listitem"><p>
              If your current MySQL installation was installed on Ubuntu
              using the MySQL APT repository, see
              <a class="xref" href="installing.html#updating-apt-repo" title="2.11.1.4 Upgrading MySQL with the MySQL APT Repository">Section 2.11.1.4, “Upgrading MySQL with the MySQL APT Repository”</a>.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-paths"></a>Upgrade Paths</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Upgrade from MySQL 5.7 to 8.0
              is supported. However, upgrade is only supported between
              General Availability (GA) releases. For MySQL
              8.0, it is required that you upgrade from a
              MySQL 5.7 GA release (5.7.9 or higher).
              Upgrades from non-GA releases of MySQL 5.7
              are not supported.
            </p></li><li class="listitem"><p>
              Upgrading to the latest release is recommended before
              upgrading to the next version. For example, upgrade to the
              latest MySQL 5.7 release before upgrading to
              MySQL 8.0.
            </p></li><li class="listitem"><p>
              Upgrade that skips versions is not supported. For example,
              upgrading directly from MySQL 5.6 to 8.0 is
              not supported.
            </p></li><li class="listitem"><p>
              Once a release series reaches General Availability (GA)
              status, upgrade within a release series from one GA
              version to another GA version is supported. For example,
              upgrading from MySQL
              8.0.<em class="replaceable"><code>x</code></em> to
              8.0.<em class="replaceable"><code>y</code></em> is
              supported. (Upgrade involving development-status releases
              is not supported.) Skipping a release is also supported.
              For example, upgrading from MySQL
              8.0.<em class="replaceable"><code>x</code></em> to
              8.0.<em class="replaceable"><code>z</code></em> is
              supported. MySQL 8.0.11 is the first GA status release
              within the MySQL 8.0 release series.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-before-you-begin"></a>Before You Begin</h5>

</div>

</div>

</div>
<p>
          Before upgrading, review the following information and perform
          any recommended steps:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Protect your data by creating a backup of your current
              databases and log files. The backup should include the
              <code class="literal">mysql</code> system database, which contains
              the MySQL data dictionary tables and system tables. See
              <a class="xref" href="backup-and-recovery.html#backup-methods" title="7.2 Database Backup Methods">Section 7.2, “Database Backup Methods”</a>.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
                Downgrade from MySQL 8.0 to MySQL
                5.7 (or from a MySQL 8.0
                release to a previous MySQL 8.0 release) is
                not supported. The only supported alternative is to
                restore a backup taken <span class="emphasis"><em>before</em></span>
                upgrading. It is therefore imperative that you backup
                your data before starting the upgrade process.
</p>
</div>
</li><li class="listitem"><p>
              MySQL Server 8.0 incorporates a global data
              dictionary containing information about database objects
              in transactional tables. In previous MySQL series,
              dictionary data was stored in metadata files and
              nontransactional system tables. Upgrading from MySQL
              5.7 to MySQL 8.0 upgrades the
              data directory from the file-based structure to the
              data-dictionary structure.
            </p><p>
              After you upgrade, a data dictionary-enabled server
              entails some general operational differences; see
              <a class="xref" href="data-dictionary.html#data-dictionary-usage-differences" title="14.7 Data Dictionary Usage Differences">Section 14.7, “Data Dictionary Usage Differences”</a>.
            </p></li><li class="listitem"><p>
              Review <a class="xref" href="installing.html#upgrading-from-previous-series" title="2.11.1.2 Changes Affecting Upgrades to MySQL 8.0">Section 2.11.1.2, “Changes Affecting Upgrades to MySQL 8.0”</a> to
              identify changes in MySQL 8.0 that may affect
              your MySQL installation and applications. Some changes may
              require action before or after upgrading.
            </p></li><li class="listitem"><p>
              Review the
              <a class="ulink" href="http://dev.mysql.com/doc/relnotes/mysql/8.0/en/" target="_top">Release
              Notes</a> which provide information about features
              that are new in the MySQL 8.0 or differ from
              those found in earlier MySQL releases. Some of these
              changes may result in incompatibilities.
            </p></li><li class="listitem"><p>
              Review <a class="xref" href="introduction.html#mysql-nutshell-removals" title="Features Removed in MySQL 8.0">Features Removed in MySQL 8.0</a> for MySQL
              server features that have been removed in MySQL
              8.0. An upgrade requires changes with respect
              to those features if you use any of them.
            </p></li><li class="listitem"><p>
              Review <a class="xref" href="introduction.html#added-deprecated-removed" title="1.5 Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 8.0">Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in
    MySQL 8.0”</a> for
              MySQL server variables and options that have been added,
              deprecated, or removed in MySQL 8.0. If you
              use any of these, an upgrade requires configuration
              changes.
            </p></li><li class="listitem"><p>
              If you use replication, review
              <a class="xref" href="replication.html#replication-upgrade" title="17.4.3 Upgrading a Replication Setup">Section 17.4.3, “Upgrading a Replication Setup”</a>.
            </p></li><li class="listitem"><p>
              If your MySQL installation contains a large amount of data
              that might take a long time to convert after an in-place
              upgrade, you might find it useful to create a
              <span class="quote">“<span class="quote">dummy</span>”</span> database instance for assessing what
              conversions might be needed and the work involved to
              perform them. Make a copy of your MySQL instance that
              contains a full copy of the <code class="literal">mysql</code>
              database, plus all other databases without data. Run your
              upgrade procedure on this dummy instance to see what
              actions might be needed so that you can better evaluate
              the work involved when performing actual data conversion
              on your original database instance.
            </p></li><li class="listitem"><p>
              Rebuilding and reinstalling MySQL language interfaces is
              recommended whenever you install or upgrade to a new
              release of MySQL. This applies to MySQL interfaces such as
              PHP <code class="literal">mysql</code> extensions, the Perl
              <code class="literal">DBD::mysql</code> module, and the Python
              <code class="literal">MySQLdb</code> module.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
            In the instructions that follow, MySQL commands that must be
            run using a MySQL account with administrative privileges
            include <code class="option">-u <code class="literal">root</code></code> on the
            command line to specify the MySQL <code class="literal">root</code>
            user. Commands that require a password for
            <code class="literal">root</code> also include a <code class="option">-p</code>
            option. Because <code class="option">-p</code> is followed by no option
            value, such commands prompt for the password. Type the
            password when prompted and press Enter.
          </p><p>
            SQL statements can be executed using the
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> command-line client (connect as
            <code class="literal">root</code> to ensure that you have the
            necessary privileges).
</p>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-prerequisites"></a>Verifying Upgrade Prerequisites for Your MySQL 5.7
Installation</h5>
</div>
</div>
</div>
<p>
          Before upgrading to MySQL 8.0, it is necessary to
          ensure the upgrade readiness of your installation by using
          your MySQL 5.7 server to perform several
          preliminary checks. The upgrade process may fail otherwise.
        </p><p>
          Preliminary checks:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
              There must be no tables that use obsolete data types,
              obsolete functions, orphan <code class="filename">.frm</code>
              files, <code class="literal">InnoDB</code> tables that use nonnative
              partitioning, or triggers that have a missing or empty
              definer or an invalid creation context (indicated by the
              <code class="literal">character_set_client</code>,
              <code class="literal">collation_connection</code>, <code class="literal">Database
              Collation</code> attributes displayed by
              <a class="link" href="sql-syntax.html#show-triggers" title="13.7.6.38 SHOW TRIGGERS Syntax"><code class="literal">SHOW TRIGGERS</code></a> or the
              <code class="literal">INFORMATION_SCHEMA</code>
              <a class="link" href="information-schema.html#triggers-table" title="24.30 The INFORMATION_SCHEMA TRIGGERS Table"><code class="literal">TRIGGERS</code></a> table).
            </p><p>
              To identify tables and triggers that fail these
              requirements, execute this command:
            </p><pre data-lang="terminal" class="programlisting">
mysqlcheck -u root -p --all-databases --check-upgrade
</pre><p>
              If <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> reports any errors,
              correct the issues.
            </p></li><li class="listitem"><p>
              There must be no partitioned tables that use a storage
              engine that does not have native partitioning support. To
              identify such tables, execute this query:
            </p><pre data-lang="sql" class="programlisting">
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE NOT IN ('innodb', 'ndbcluster')
AND CREATE_OPTIONS LIKE '%partitioned%';
</pre><p>
              Any table reported by the query must be altered to use
              <code class="literal">InnoDB</code> or be made nonpartitioned. To
              change a table storage engine to
              <code class="literal">InnoDB</code>, execute this statement:
            </p><pre data-lang="sql" class="programlisting">
ALTER TABLE <em class="replaceable"><code>table_name</code></em> ENGINE = INNODB;
</pre><p>
              For information about converting <code class="literal">MyISAM</code>
              tables to <code class="literal">InnoDB</code>, see
              <a class="xref" href="innodb-storage-engine.html#converting-tables-to-innodb" title="15.8.1.4 Converting Tables from MyISAM to InnoDB">Section 15.8.1.4, “Converting Tables from MyISAM to InnoDB”</a>.
            </p><p>
              To make a partitioned table nonpartitioned, execute this
              statement:
            </p><pre data-lang="sql" class="programlisting">
ALTER TABLE <em class="replaceable"><code>table_name</code></em> REMOVE PARTITIONING;
</pre></li><li class="listitem"><p>
              There must be no tables in the MySQL 5.7
              <code class="literal">mysql</code> system database that have the
              same name as a table used by the MySQL 8.0
              data dictionary. To identify tables with those names,
              execute this query:
            </p><pre data-lang="sql" class="programlisting">
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE LOWER(TABLE_SCHEMA) = 'mysql'
and LOWER(TABLE_NAME) IN
(
'catalogs',
'character_sets',
'collations',
'column_statistics',
'column_type_elements',
'columns',
'dd_properties',
'events',
'foreign_key_column_usage',
'foreign_keys',
'index_column_usage',
'index_partitions',
'index_stats',
'indexes',
'parameter_type_elements',
'parameters',
'resource_groups',
'routines',
'schemata',
'st_spatial_reference_systems',
'table_partition_values',
'table_partitions',
'table_stats',
'tables',
'tablespace_files',
'tablespaces',
'triggers',
'view_routine_usage',
'view_table_usage'
);
</pre><p>
              Any tables reported by the query must be renamed (use
              <a class="link" href="sql-syntax.html#rename-table" title="13.1.33 RENAME TABLE Syntax"><code class="literal">RENAME TABLE</code></a>). This may
              also entail changes to applications that use the affected
              tables.
            </p></li><li class="listitem"><p>
              There must be no tables that have foreign key constraint
              names longer than 64 characters. To identify tables with
              too-long constraint names, execute this query:
            </p><pre data-lang="sql" class="programlisting">
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME IN
  (SELECT LEFT(SUBSTR(ID,INSTR(ID,'/')+1),
               INSTR(SUBSTR(ID,INSTR(ID,'/')+1),'_ibfk_')-1)
   FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN
   WHERE LENGTH(SUBSTR(ID,INSTR(ID,'/')+1))&gt;64);
</pre><p>
              Any tables reported by the query must be altered to have
              constraint names no longer than 64 characters (use
              <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>).
            </p></li><li class="listitem"><p>
              Your MySQL 5.7 installation must not use
              features that are not supported by MySQL 8.0.
              Any changes here are necessarily installation specific,
              but the following examples illustrate the kind of things
              to look for:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  Tables that use a storage engine not supported in
                  MySQL 8.0 must be altered to use a
                  supported engine. For example, MySQL 8.0
                  does not yet support MySQL Cluster, so
                  <code class="literal">NDB</code> tables must be altered to use a
                  different storage engine.
                </p></li><li class="listitem"><p>
                  Some server startup options and system variables have
                  been removed in MySQL 8.0. See
                  <a class="xref" href="introduction.html#mysql-nutshell-removals" title="Features Removed in MySQL 8.0">Features Removed in MySQL 8.0</a>,
                  and
                  <a class="xref" href="introduction.html#added-deprecated-removed" title="1.5 Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 8.0">Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in
    MySQL 8.0”</a>.
                  If you use any of these, an upgrade requires
                  configuration changes.
                </p><p>
                  Example: Because the data dictionary provides
                  information about database objects, the server no
                  longer checks directory names in the data directory to
                  find databases. Consequently, the
                  <code class="option">--ignore-db-dir</code> option is extraneous
                  and has been removed. To handle this, remove any
                  instances of <code class="option">--ignore-db-dir</code> from
                  your startup configuration. In addition, remove or
                  move the named data directory subdirectories before
                  upgrading to MySQL 8.0. (Alternatively,
                  let the 8.0 server add those directories
                  to the data dictionary as databases, then remove each
                  of those databases using <a class="link" href="sql-syntax.html#drop-database" title="13.1.22 DROP DATABASE Syntax"><code class="literal">DROP
                  DATABASE</code></a>.)
</p></li></ul>
</div>
</li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-procedure-inplace"></a>In-Place Upgrade</h5>

</div>

</div>

</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
            If you are upgrading an installation originally produced by
            installing multiple RPM packages, upgrade all the packages,
            not just some. For example, if you previously installed the
            server and client RPMs, do not upgrade just the server RPM.
          </p><p>
            For some Linux platforms, MySQL installation from RPM or
            Debian packages includes systemd support for managing MySQL
            server startup and shutdown. On these platforms,
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is not installed. In such
            cases, use systemd for server startup and shutdown instead
            of the methods used in the following instructions. See
            <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
</p>
</div>
<p>
          To perform an in-place upgrade:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
              Review the information in
              <a class="xref" href="installing.html#upgrade-before-you-begin" title="Before You Begin">Before You Begin</a>.
            </p></li><li class="listitem"><p>
              Ensure the upgrade readiness of your installation by
              completing the preliminary checks in
              <a class="xref" href="installing.html#upgrade-prerequisites" title="Verifying Upgrade Prerequisites for Your MySQL 5.7 Installation">Verifying Upgrade Prerequisites for Your MySQL 5.7
          Installation</a>.
            </p></li><li class="listitem"><p>
              If you use XA transactions with <code class="literal">InnoDB</code>,
              run <a class="link" href="sql-syntax.html#xa-statements" title="13.3.8.1 XA Transaction SQL Syntax"><code class="literal">XA
              RECOVER</code></a> before upgrading to check for
              uncommitted XA transactions. If results are returned,
              either commit or rollback the XA transactions by issuing
              an <a class="link" href="sql-syntax.html#xa-statements" title="13.3.8.1 XA Transaction SQL Syntax"><code class="literal">XA
              COMMIT</code></a> or
              <a class="link" href="sql-syntax.html#xa-statements" title="13.3.8.1 XA Transaction SQL Syntax"><code class="literal">XA
              ROLLBACK</code></a> statement.
            </p></li><li class="listitem"><p>
              With your MySQL 5.7 server, if there are
              encrypted <code class="literal">InnoDB</code> tablespaces, rotate
              the keyring master key by executing this statement:
            </p><pre data-lang="sql" class="programlisting">
ALTER INSTANCE ROTATE INNODB MASTER KEY;
</pre></li><li class="listitem"><p>
              If you normally run your MySQL 5.7 server
              configured with
              <a class="link" href="innodb-storage-engine.html#sysvar_innodb_fast_shutdown"><code class="literal">innodb_fast_shutdown</code></a> set
              to <code class="literal">2</code> (cold shutdown), configure it to
              perform a fast or slow shutdown by executing either of
              these statements:
            </p><pre data-lang="sql" class="programlisting">
SET GLOBAL innodb_fast_shutdown = 1; -- fast shutdown
SET GLOBAL innodb_fast_shutdown = 0; -- slow shutdown
</pre><p>
              With a fast or slow shutdown, <code class="literal">InnoDB</code>
              leaves its undo logs and data files in a state that can be
              dealt with in case of file format differences between
              releases.
            </p></li><li class="listitem"><p>
              Shut down the old MySQL server. For example:
            </p><pre data-lang="terminal" class="programlisting">
mysqladmin -u root -p shutdown
</pre></li><li class="listitem"><p>
              Upgrade the MySQL binary installation or packages. If
              upgrading a binary installation, unpack the new MySQL
              binary distribution package. See
              <a class="xref" href="installing.html#binary-installation-unpack" title="Obtain and Unpack the Distribution">Obtain and Unpack the Distribution</a>. For
              package-based installations, replace the old packages with
              the new ones.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                For supported Linux distributions, the preferred method
                for replacing the MySQL packages is to use the MySQL
                software repositories; see
                <a class="xref" href="installing.html#updating-yum-repo" title="2.11.1.3 Upgrading MySQL with the MySQL Yum Repository">Section 2.11.1.3, “Upgrading MySQL with the MySQL Yum Repository”</a>,
                <a class="xref" href="installing.html#updating-apt-repo" title="2.11.1.4 Upgrading MySQL with the MySQL APT Repository">Section 2.11.1.4, “Upgrading MySQL with the MySQL APT Repository”</a>, or
                <a class="ulink" href="http://dev.mysql.com/doc/mysql-sles-repo-quick-guide/en/#repo-qg-sles-upgrading" target="_top">Upgrading
                MySQL with the MySQL SLES Repository</a> for
                instructions.
</p>
</div>
</li><li class="listitem"><p>
              Start the MySQL 8.0 server, using the
              existing data directory. For example:
            </p><pre data-lang="terminal" class="programlisting">
mysqld_safe --user=mysql --datadir=<em class="replaceable"><code>/path/to/existing-datadir</code></em>
</pre><p>
              If there are encrypted <code class="literal">InnoDB</code>
              tablespaces, use the
              <a class="link" href="server-administration.html#option_mysqld_early-plugin-load"><code class="option">--early-plugin-load</code></a> option
              to load the keyring plugin.
            </p><p>
              When you start the MySQL 8.0 server, it
              automatically detects whether data dictionary tables are
              present. If not, the server creates them in the data
              directory, populates them with metadata, and then proceeds
              with its normal startup sequence. During this process, the
              server upgrades metadata for all database objects,
              including databases, tablespaces, system and user tables,
              views, and stored programs (stored procedures and
              functions, triggers, Event Scheduler events). The server
              also removes files that previously were used for metadata
              storage. For example, after upgrading, you will notice
              that your tables no longer have <code class="filename">.frm</code>
              files.
            </p><p>
              If this step succeeds, the server performs a cleanup:
</p><a class="indexterm" name="idm139899653960048"></a><a class="indexterm" name="idm139899653958960"></a><a class="indexterm" name="idm139899653957888"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  In the data directory, the server creates a directory
                  named <code class="filename">backup_metadata_57</code> and
                  moves into it files named <code class="filename">db.opt</code>
                  and files with a suffix of <code class="filename">.frm</code>,
                  <code class="filename">.par</code>, <code class="filename">.TRG</code>,
                  <code class="filename">.TRN</code>, or
                  <code class="filename">.isl</code>. (These are files previously
                  used for metadata storage.)
                </p><p>
                  Files in the <code class="filename">backup_metadata_57</code>
                  directory retain the original file system hierarchy.
                  For example, if <code class="filename">t1.frm</code> was
                  located in the <code class="filename">my_schema1</code>
                  directory under the data directory, the server moves
                  it to the
                  <code class="filename">backup_metadata_57/my_schema1</code>
                  directory.
                </p></li><li class="listitem"><p>
                  In the <code class="literal">mysql</code> database, the server
                  renames the <code class="literal">event</code> and
                  <code class="literal">proc</code> tables to
                  <code class="literal">event_backup_57</code> and
                  <code class="literal">proc_backup_57</code>.
</p></li></ul>
</div>
<p>
              If this step fails, the server reverts all changes to the
              data directory. In this case, you should remove all redo
              log files, start your MySQL 5.7 server on
              the same data directory, and fix the cause of any errors.
              Then perform another slow shutdown of the
              5.7 server and start the MySQL
              8.0 server to try again.
            </p></li><li class="listitem"><p>
              After the MySQL 8.0 server starts
              successfully, execute <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>:
            </p><pre data-lang="terminal" class="programlisting">
mysql_upgrade -u root -p
</pre><p>
              <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> examines all tables in
              all databases for incompatibilities with the current
              version of MySQL. It makes any remaining changes required
              in the <code class="literal">mysql</code> system database between
              MySQL 5.7 and MySQL 8.0, so
              that you can take advantage of new privileges or
              capabilities. <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> also brings
              the Performance Schema,
              <code class="literal">INFORMATION_SCHEMA</code>, and
              <code class="literal">sys</code> schema objects up to date for MySQL
              8.0.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> does not upgrade the
                contents of the help tables. For upgrade instructions,
                see <a class="xref" href="server-administration.html#server-side-help-support" title="5.1.11 Server-Side Help">Section 5.1.11, “Server-Side Help”</a>.
</p>
</div>
</li><li class="listitem"><p>
              Shut down and restart the MySQL server to ensure that any
              changes made to the system tables take effect. For
              example:
            </p><pre data-lang="terminal" class="programlisting">
mysqladmin -u root -p shutdown
mysqld_safe --user=mysql --datadir=<em class="replaceable"><code>/path/to/existing-datadir</code></em>
</pre><p>
              The first time you started the MySQL 8.0
              server (in an earlier step), you may have noticed messages
              written to the error log regarding nonupgraded tables. If
              <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> has been run
              successfully, there should be no such messages the second
              time you start the server.
</p></li></ol>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-troubleshooting"></a>Upgrade Troubleshooting</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              If problems occur, such as that the new
              <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server does not start, verify
              that you do not have an old <code class="filename">my.cnf</code>
              file from your previous installation. You can check this
              with the <a class="link" href="programs.html#option_general_print-defaults"><code class="option">--print-defaults</code></a>
              option (for example, <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld
              --print-defaults</strong></span></a>). If this command displays
              anything other than the program name, you have an active
              <code class="filename">my.cnf</code> file that affects server or
              client operation.
            </p></li><li class="listitem"><p>
              If, after an upgrade, you experience problems with
              compiled client programs, such as <code class="literal">Commands out of
              sync</code> or unexpected core dumps, you probably have
              used old header or library files when compiling your
              programs. In this case, check the date for your
              <code class="filename">mysql.h</code> file and
              <code class="filename">libmysqlclient.a</code> library to verify
              that they are from the new MySQL distribution. If not,
              recompile your programs with the new headers and
              libraries. Recompilation might also be necessary for
              programs compiled against the shared client library if the
              library major version number has changed (for example,
              from <code class="filename">libmysqlclient.so.20</code> to
              <code class="filename">libmysqlclient.so.21</code>).
            </p></li><li class="listitem"><p>
              If you have created a user-defined function (UDF) with a
              given name and upgrade MySQL to a version that implements
              a new built-in function with the same name, the UDF
              becomes inaccessible. To correct this, use
              <a class="link" href="sql-syntax.html#drop-function" title="13.1.24 DROP FUNCTION Syntax"><code class="literal">DROP FUNCTION</code></a> to drop the
              UDF, and then use <a class="link" href="sql-syntax.html#create-function" title="13.1.13 CREATE FUNCTION Syntax"><code class="literal">CREATE
              FUNCTION</code></a> to re-create the UDF with a different
              nonconflicting name. The same is true if the new version
              of MySQL implements a built-in function with the same name
              as an existing stored function. See
              <a class="xref" href="language-structure.html#function-resolution" title="9.2.4 Function Name Parsing and Resolution">Section 9.2.4, “Function Name Parsing and Resolution”</a>, for the rules
              describing how the server interprets references to
              different kinds of functions.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="upgrading-from-previous-series"></a>2.11.1.2 Changes Affecting Upgrades to MySQL 8.0</h4>

</div>

</div>

</div>
<p>
        Before upgrading to MySQL 8.0, review the changes
        described in this section to identify upgrade issues that apply
        to your MySQL installation and applications.
      </p><p>
        Changes marked as either <span class="bold"><strong>Known
        issue</strong></span> or <span class="bold"><strong>Incompatible
        change</strong></span> are incompatibilities with earlier versions of
        MySQL, and may require your attention <span class="emphasis"><em>before you
        upgrade</em></span>. Our aim is to avoid these changes, but
        occasionally they are necessary to correct problems that would
        be worse than an incompatibility between releases. If any
        upgrade issue applicable to your installation involves an
        incompatibility that requires special handling, follow the
        instructions given in the description.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#upgrade-data-dictionary-changes" title="Data Dictionary Changes">Data Dictionary Changes</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-caching-sha2-password" title="caching_sha2_password as the Preferred Authentication Plugin">caching_sha2_password as the Preferred Authentication Plugin</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-configuration-changes" title="Configuration Changes">Configuration Changes</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-server-changes" title="Server Changes">Server Changes</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-innodb-changes" title="InnoDB Changes">InnoDB Changes</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-sql-changes" title="SQL Changes">SQL Changes</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="upgrade-data-dictionary-changes"></a>Data Dictionary Changes</h5>

</div>

</div>

</div>
<p>
          MySQL Server 8.0 incorporates a global data
          dictionary containing information about database objects in
          transactional tables. In previous MySQL series, dictionary
          data was stored in metadata files and nontransactional system
          tables. As a result, the upgrade procedure is somewhat
          different from previous MySQL releases and requires that you
          verify the upgrade readiness of your installation by checking
          specific prerequisites. For more information, see
          <a class="xref" href="installing.html#upgrade-prerequisites" title="Verifying Upgrade Prerequisites for Your MySQL 5.7 Installation">Verifying Upgrade Prerequisites for Your MySQL 5.7
          Installation</a>. A data
          dictionary-enabled server entails some general operational
          differences; see
          <a class="xref" href="data-dictionary.html#data-dictionary-usage-differences" title="14.7 Data Dictionary Usage Differences">Section 14.7, “Data Dictionary Usage Differences”</a>.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-caching-sha2-password"></a>caching_sha2_password as the Preferred Authentication Plugin</h5>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653891168"></a><p>
          The <code class="literal">caching_sha2_password</code> and
          <code class="literal">sha256_password</code> authentication plugins
          provide more secure password encryption than the
          <code class="literal">mysql_native_password</code> plugin, and
          <code class="literal">caching_sha2_password</code> provides better
          performance than <code class="literal">sha256_password</code>. Due to
          these superior security and performance characteristics of
          <code class="literal">caching_sha2_password</code>, it is as of MySQL
          8.0.4 the preferred authentication plugin, and is also the
          default authentication plugin rather than
          <code class="literal">mysql_native_password</code>. This change affects
          both the server and the <code class="literal">libmysqlclient</code>
          client library:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              For the server, the default value of the
              <a class="link" href="server-administration.html#sysvar_default_authentication_plugin"><code class="literal">default_authentication_plugin</code></a>
              system variable changes from
              <code class="literal">mysql_native_password</code> to
              <code class="literal">caching_sha2_password</code>.
            </p><p>
              This change applies only to new accounts created after
              installing or upgrading to MySQL 8.0.4 or later. For
              accounts already existing in an upgraded installation,
              their authentication plugin remains unchanged. Existing
              users who wish to switch to
              <code class="literal">caching_sha2_password</code> can do so using
              the <a class="link" href="sql-syntax.html#alter-user" title="13.7.1.1 ALTER USER Syntax"><code class="literal">ALTER USER</code></a> statement:
            </p><pre data-lang="sql" class="programlisting">
ALTER USER <em class="replaceable"><code>user</code></em>
  IDENTIFIED WITH caching_sha2_password
  BY '<em class="replaceable"><code>password</code></em>';
</pre></li><li class="listitem"><p>
              The <code class="literal">libmysqlclient</code> library treats
              <code class="literal">caching_sha2_password</code> as the default
              authentication plugin rather than
              <code class="literal">mysql_native_password</code>.
</p></li></ul>
</div>
<p>
          The following sections discuss the implications of the more
          prominent role of <code class="literal">caching_sha2_password</code>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#upgrade-caching-sha2-password-compatible-connectors" title="caching_sha2_password-Compatible Clients and Connectors">caching_sha2_password-Compatible Clients and Connectors</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-caching-sha2-password-compatibility-issues" title="caching_sha2_password Compatibility Issues and Solutions">caching_sha2_password Compatibility Issues and Solutions</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-caching-sha2-password-root-account" title="caching_sha2_password and the root Administrative Account">caching_sha2_password and the root Administrative Account</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#upgrade-caching-sha2-password-replication" title="caching_sha2_password and Replication">caching_sha2_password and Replication</a></p></li></ul>
</div>
<h6><a name="upgrade-caching-sha2-password-compatible-connectors"></a>caching_sha2_password-Compatible Clients and Connectors</h6><p>
          If a client or connector is available that has been updated to
          know about <code class="literal">caching_sha2_password</code>, using it
          is the best way to ensure compatibility when connecting to a
          MySQL 8.0 server configured with
          <code class="literal">caching_sha2_password</code> as the default
          authentication plugin.
        </p><p>
          These clients and connectors have been upgraded to support
          <code class="literal">caching_sha2_password</code>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              The <code class="literal">libmysqlclient</code> client library in
              MySQL 8.0.4 or higher. Standard MySQL clients such as
              <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> and <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>
              are <code class="literal">libmysqlclient</code>-based, so they are
              compatible as well.
            </p></li><li class="listitem"><p>
              MySQL Connector/J 8.0.9 or higher.
            </p></li><li class="listitem"><p>
              MySQL Connector/Net 8.0.10 or higher (through the classic MySQL
              protocol).
            </p></li><li class="listitem"><p>
              MySQL Connector/Node.js 8.0.9 or higher.
</p></li></ul>
</div>
<h6><a name="upgrade-caching-sha2-password-compatibility-issues"></a>caching_sha2_password Compatibility Issues and Solutions</h6>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
            If your MySQL installation must serve pre-8.0 clients and
            you encounter compatibility issues after upgrading to MySQL
            8.0.4 or later, the simplest way to address those issues and
            restore pre-8.0 compatibility is to reconfigure the server
            to revert to the previous default authentication plugin
            (<code class="literal">mysql_native_password</code>). For example, use
            these lines in the server option file:
          </p><pre data-lang="ini" class="programlisting">
[mysqld]
default_authentication_plugin=mysql_native_password
</pre><p>
            That setting enables pre-8.0 clients to connect to 8.0
            servers until such time as the clients and connectors in use
            at your installation are upgraded to know about
            <code class="literal">caching_sha2_password</code>. However, the
            setting should be viewed as temporary, not as a long term or
            permanent solution, because it causes new accounts created
            with the setting in effect to forego the improved
            authentication security provided by
            <code class="literal">caching_sha2_password</code>.
</p>
</div>
<p>
          The use of <code class="literal">caching_sha2_password</code> offers
          more secure password hashing than
          <code class="literal">mysql_native_password</code> (and consequent
          improved client connection authentication). However, it also
          has compatibility implications that may affect existing MySQL
          installations:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Clients that use an account that authenticates with
              <code class="literal">caching_sha2_password</code> must use either a
              secure connection (made using TCP using TLS/SSL
              credentials, a Unix socket file, or shared memory), or an
              unencrypted connection that supports password exchange
              using an RSA key pair. This security requirement does not
              apply to <code class="literal">mysql_native_passsword</code>, so the
              switch to <code class="literal">caching_sha2_password</code> may
              require additional configuration (see
              <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.5.1.3 Caching SHA-2 Pluggable Authentication">Section 6.5.1.3, “Caching SHA-2 Pluggable Authentication”</a>).
              However, client connections in MySQL 8.0 prefer use of
              TLS/SSL by default, so clients that already conform to
              that preference may need no additional configuration.
            </p></li><li class="listitem"><p>
              Clients and connectors that have not been updated to know
              about <code class="literal">caching_sha2_password</code>
              <span class="emphasis"><em>cannot</em></span> connect to accounts that
              authenticate with <code class="literal">caching_sha2_password</code>
              because they do not recognize this plugin as valid. (This
              is a particular instance of how client/server
              authentication plugin compatibility requirements apply, as
              discussed at
              <a class="xref" href="security.html#pluggable-authentication-compatibility" title="Authentication Plugin Client/Server Compatibility">Authentication Plugin Client/Server Compatibility</a>.)
              To work around this issue, relink clients against
              <code class="literal">libmysqlclient</code> from MySQL 8.0.4 or
              higher, or obtain an updated connector that recognizes
              <code class="literal">caching_sha2_password</code>.
            </p></li><li class="listitem"><p>
              Clients and connectors that have not been updated to know
              about <code class="literal">caching_sha2_password</code> may have
              trouble connecting to a MySQL 8.0 server configured with
              <code class="literal">caching_sha2_password</code> as the default
              authentication plugin, even to use accounts that do not
              authenticate with
              <code class="literal">caching_sha2_password</code>. This issue
              occurs because the server specifies the name of its
              default authentication plugin to clients. If a client or
              connector is based on a client/server protocol
              implementation that does not gracefully handle an
              unrecognized default authentication plugin, it may fail
              with an error such as this:
            </p><pre data-lang="none" class="programlisting">
Authentication plugin 'caching_sha2_password' is not supported
</pre><p>
              For information about writing connectors to gracefully
              handle requests from the server for unknown default
              authentication plugins, see
              <a class="xref" href="security.html#pluggable-authentication-connector-writing" title="Authentication Plugin Connector-Writing Considerations">Authentication Plugin Connector-Writing Considerations</a>.
            </p></li><li class="listitem"><p>
              Because <code class="literal">caching_sha2_password</code> is also
              now the default authentication plugin in the
              <code class="literal">libmysqlclient</code> client library,
              authentication requires an extra round trip in the
              client/server protocol for connections from MySQL 8.0
              clients to accounts that use
              <code class="literal">mysql_native_password</code> (the previous
              default authentication plugin), unless the client program
              is invoked with a
              <a class="link" href="programs.html#option_general_default-auth"><code class="option">--default-auth=mysql_native_password</code></a>
              option.
</p></li></ul>
</div>
<p>
          The <code class="literal">libmysqlclient</code> client library for
          pre-8.0 MySQL versions is able to connect to MySQL 8.0 servers
          (except for accounts that authenticate with
          <code class="literal">caching_sha2_password</code>). That means pre-8.0
          clients based on <code class="literal">libmysqlclient</code> should also
          be able to connect. Examples:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Standard MySQL clients such as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a>
              and <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> are
              <code class="literal">libmysqlclient</code>-based.
            </p></li><li class="listitem"><p>
              The DBD::mysql driver for Perl DBI is
              <code class="literal">libmysqlclient</code>-based.
            </p></li><li class="listitem"><p>
              MySQL Connector/Python has a C Extension module that is
              <code class="literal">libmysqlclient</code>-based. To use it,
              include the <code class="literal">use_pure=False</code> option at
              connect time.
</p></li></ul>
</div>
<p>
          When an existing MySQL 8.0 installation is upgraded to MySQL
          8.0.4 or higher, some older
          <code class="literal">libmysqlclient</code>-based clients may
          <span class="quote">“<span class="quote">automatically</span>”</span> upgrade if they are dynamically
          linked, because they use the new client library installed by
          the upgrade. For example, if the DBD::mysql driver for Perl
          DBI uses dynamic linking, it can use the
          <code class="literal">libmysqlclient</code> in place after an upgrade to
          MySQL 8.0.4 or higher, with this result:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Prior to the upgrade, DBI scripts that use DBD::mysql can
              connect to a MySQL 8.0 server, except for accounts that
              authenticate with
              <code class="literal">caching_sha2_password</code>.
            </p></li><li class="listitem"><p>
              After the upgrade, the same scripts become able to use
              <code class="literal">caching_sha2_password</code> accounts as well.
</p></li></ul>
</div>
<p>
          However, the preceding results occur because
          <code class="literal">libmysqlclient</code> instances from MySQL 8.0
          installations prior to 8.0.4 are binary compatible: They both
          use a shared library major version number of 21. For clients
          linked to <code class="literal">libmysqlclient</code> from MySQL 5.7 or
          older, they link to a shared library with a different version
          number that is not binary compatible. In this case, the client
          must be recompiled against <code class="literal">libmysqlclient</code>
          from 8.0.4 or higher for full compatibility with MySQL 8.0
          servers and <code class="literal">caching_sha2_password</code> accounts.
        </p><p>
          MySQL Connector/J 5.1 through 8.0.8 is able to connect to MySQL 8.0
          servers, except for accounts that authenticate with
          <code class="literal">caching_sha2_password</code>. (Connector/J 8.0.9 or
          higher is required to connect to
          <code class="literal">caching_sha2_password</code> accounts.)
        </p><p>
          Clients that use an implementation of the client/server
          protocol other than <code class="literal">libmysqlclient</code> may need
          to be upgraded to a newer version that understands the new
          authentication plugin. For example, in PHP, MySQL connectivity
          usually is based on <code class="literal">mysqlnd</code>, which
          currently does not know about
          <code class="literal">caching_sha2_password</code>. Until an updated
          version of <code class="literal">mysqlnd</code> is available, the way to
          enable PHP clients to connect to MySQL 8.0 is to reconfigure
          the server to revert to
          <code class="literal">mysql_native_password</code> as the default
          authentication plugin, as previously discussed.
        </p><p>
          If a client or connector supports an option to explicitly
          specify a default authentication plugin, use it to name a
          plugin other than <code class="literal">caching_sha2_password</code>.
          Examples:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Some MySQL clients support a
              <a class="link" href="programs.html#option_general_default-auth"><code class="option">--default-auth</code></a> option.
              (Standard MySQL clients such as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a>
              and <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> support this option but
              can successfully connect to 8.0 servers without it.
              However, other clients may support a similar option. If
              so, it is worth trying it.)
            </p></li><li class="listitem"><p>
              Programs that use the <code class="literal">libmysqlclient</code> C
              API can call the
              <a class="link" href="connectors-apis.html#mysql-options" title="27.7.7.50 mysql_options()"><code class="literal">mysql_options()</code></a> function
              with the <code class="literal">MYSQL_DEFAULT_AUTH</code> option.
            </p></li><li class="listitem"><p>
              MySQL Connector/Python scripts that use the native Python implementation
              of the client/server protocol can specify the
              <code class="literal">auth_plugin</code> connection option.
              (Alternatively, use the Connector/Python C Extension, which is able
              to connect to MySQL 8.0 servers without the need for
              <code class="literal">auth_plugin</code>.)
</p></li></ul>
</div>
<h6><a name="upgrade-caching-sha2-password-root-account"></a>caching_sha2_password and the root Administrative Account</h6><p>
          For upgrades to MySQL 8.0, the authentication plugin existing
          accounts remains unchanged, including the plugin for the
          <code class="literal">'root'@'localhost'</code> administrative account.
        </p><p>
          For new MySQL 8.0 installations, when you initialize the data
          directory (using the instructions at
          <a class="xref" href="installing.html#data-directory-initialization-mysqld" title="2.10.1.1 Initializing the Data Directory Manually Using mysqld">Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”</a>), the
          <code class="literal">'root'@'localhost'</code> account is created, and
          that account uses <code class="literal">caching_sha2_password</code> by
          default. To connect to the server following data directory
          initialization, you must therefore use a client or connector
          that supports <code class="literal">caching_sha2_password</code>. If you
          can do this but prefer that the <code class="literal">root</code>
          account use <code class="literal">mysql_native_password</code> after
          installation, install MySQL and initialize the data directory
          as you normally would. Then connect to the server as
          <code class="literal">root</code> and use <a class="link" href="sql-syntax.html#alter-user" title="13.7.1.1 ALTER USER Syntax"><code class="literal">ALTER
          USER</code></a> as follows to change the account authentication
          plugin and password:
        </p><pre data-lang="sql" class="programlisting">
ALTER USER 'root'@'localhost'
  IDENTIFIED WITH mysql_native_password
  BY '<em class="replaceable"><code>password</code></em>';
</pre><p>
          If the client or connector that you use does not yet support
          <code class="literal">caching_sha2_password</code>, you can use a
          modified data directory-initialization procedure that
          associates the <code class="literal">root</code> account with
          <code class="literal">mysql_native_password</code> as soon as the
          account is created. To do so, use either of these techniques:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Supply a
              <a class="link" href="server-administration.html#sysvar_default_authentication_plugin"><code class="option">--default-authentication-plugin=mysql_native_password</code></a>
              option along with
              <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
              <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>.
            </p></li><li class="listitem"><p>
              Set
              <a class="link" href="server-administration.html#sysvar_default_authentication_plugin"><code class="literal">default_authentication_plugin</code></a>
              to <code class="literal">mysql_native_password</code> in an option
              file, and name that option file using a
              <a class="link" href="server-administration.html#option_mysqld_defaults-file"><code class="option">--defaults-file</code></a> option
              along with <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
              <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a>. (In
              this case, if you continue to use that option file for
              subsequent server startups, new accounts will be created
              with <code class="literal">mysql_native_password</code> rather than
              <code class="literal">caching_sha2_password</code> unless you remove
              the
              <a class="link" href="server-administration.html#sysvar_default_authentication_plugin"><code class="literal">default_authentication_plugin</code></a>
              setting from the option file.)
</p></li></ul>
</div>
<h6><a name="upgrade-caching-sha2-password-replication"></a>caching_sha2_password and Replication</h6><p>
          In replication scenarios for which all servers have been
          upgraded to MySQL 8.0.4 or higher, slave/replica connections
          to master/primary servers can use accounts that authenticate
          with <code class="literal">caching_sha2_password</code>. For such
          connections, the same requirement applies as for other clients
          that use accounts that authenticate with
          <code class="literal">caching_sha2_password</code>: Use a secure
          connection or RSA-based password exchange.
        </p><p>
          To connect to a <code class="literal">caching_sha2_password</code>
          account for master/slave replication:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              For MySQL built using OpenSSL, use any of the following
              <a class="link" href="sql-syntax.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Syntax"><code class="literal">CHANGE MASTER TO</code></a> options:
            </p><pre data-lang="sql" class="programlisting">
MASTER_SSL = 1
GET_MASTER_PUBLIC_KEY = 1
MASTER_PUBLIC_KEY_PATH='<em class="replaceable"><code>path to RSA public key file</code></em>'
</pre></li><li class="listitem"><p>
              For MySQL built using wolfSSL, use
              <code class="literal">MASTER_SSL=1</code> with
              <a class="link" href="sql-syntax.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Syntax"><code class="literal">CHANGE MASTER TO</code></a>.
            </p><p>
              Alternatively, you can use the RSA public key-related
              options if the required keys are supplied at server
              startup.
</p></li></ul>
</div>
<p>
          To connect to a <code class="literal">caching_sha2_password</code>
          account for Group Replication:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              For MySQL built using OpenSSL, set any of the following
              system variables:
            </p><pre data-lang="sql" class="programlisting">
SET GLOBAL group_replication_recovery_use_ssl = ON;
SET GLOBAL group_replication_recovery_get_public_key = 1;
SET GLOBAL group_replication_recovery_public_key_path = '<em class="replaceable"><code>path to RSA public key file</code></em>';
</pre></li><li class="listitem"><p>
              For MySQL built using wolfSSL, set this system variable:
            </p><pre data-lang="sql" class="programlisting">
SET GLOBAL group_replication_recovery_use_ssl = ON;
</pre><p>
              Alternatively, you can use the RSA public key-related
              options if the required keys are supplied at server
              startup.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-configuration-changes"></a>Configuration Changes</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <span class="bold"><strong>Incompatible change</strong></span>: A
              MySQL storage engine is now responsible for providing its
              own partitioning handler, and the MySQL server no longer
              provides generic partitioning support.
              <a class="link" href="innodb-storage-engine.html" title="Chapter 15 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> is the only storage
              engine providing a native partitioning handler that is
              supported in MySQL 8.0. (The
              <code class="literal">NDB</code> storage engine also provides native
              partitioning support, but it is not yet supported in MySQL
              8.0.) A partitioned table using any other
              storage engine must be altered—either to convert it
              to <code class="literal">InnoDB</code>, or to remove its
              partitioning—<span class="emphasis"><em>before</em></span> upgrading
              the server, else it cannot be used afterwards.
            </p><p>
              For information about converting <code class="literal">MyISAM</code>
              tables to <code class="literal">InnoDB</code>, see
              <a class="xref" href="innodb-storage-engine.html#converting-tables-to-innodb" title="15.8.1.4 Converting Tables from MyISAM to InnoDB">Section 15.8.1.4, “Converting Tables from MyISAM to InnoDB”</a>.
            </p><p>
              A table creation statement that would result in a
              partitioned table using a storage engine without such
              support fails with an error
              (<span class="errorcode">ER_CHECK_NOT_IMPLEMENTED</span>) in MySQL
              8.0. If you import databases from a dump file
              created in MySQL 5.7 (or earlier) using
              <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> into a MySQL 8.0
              server, you must make sure that any statements creating
              partitioned tables do not also specify an unsupported
              storage engine, either by removing any references to
              partitioning, or by specifying the storage engine as
              <code class="literal">InnoDB</code> or allowing it to be set as
              <code class="literal">InnoDB</code> by default.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                The procedure given at
                <a class="xref" href="installing.html#upgrade-prerequisites" title="Verifying Upgrade Prerequisites for Your MySQL 5.7 Installation">Verifying Upgrade Prerequisites for Your MySQL 5.7
          Installation</a>, describes how
                to identify partitioned tables that must be altered
                before upgrading to MySQL 8.0.
</p>
</div>
<p>
              See
              <a class="xref" href="partitioning.html#partitioning-limitations-storage-engines" title="22.6.2 Partitioning Limitations Relating to Storage Engines">Section 22.6.2, “Partitioning Limitations Relating to Storage Engines”</a>,
              for further information.
            </p></li><li class="listitem"><p>
              <span class="bold"><strong>Incompatible change</strong></span>:
              Several server error codes are not used and have been
              removed (for a list, see
              <a class="xref" href="introduction.html#mysql-nutshell-removals" title="Features Removed in MySQL 8.0">Features Removed in MySQL 8.0</a>). Applications
              that test specifically for any of them should be updated.
            </p></li><li class="listitem"><p>
              <span class="bold"><strong>Important change</strong></span>: The
              default character set has changed from
              <code class="literal">latin1</code> to <code class="literal">utf8mb4</code>.
              These system variables are affected:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  The default value of the
                  <a class="link" href="server-administration.html#sysvar_character_set_server"><code class="literal">character_set_server</code></a>
                  and
                  <a class="link" href="server-administration.html#sysvar_character_set_database"><code class="literal">character_set_database</code></a>
                  system variables has changed from
                  <code class="literal">latin1</code> to
                  <code class="literal">utf8mb4</code>.
                </p></li><li class="listitem"><p>
                  The default value of the
                  <a class="link" href="server-administration.html#sysvar_collation_server"><code class="literal">collation_server</code></a> and
                  <a class="link" href="server-administration.html#sysvar_collation_database"><code class="literal">collation_database</code></a>
                  system variables has changed from
                  <code class="literal">latin1_swedish_ci</code> to
                  <code class="literal">utf8mb4_0900_ai_ci</code>.
</p></li></ul>
</div>
<p>
              As a result, the default character set and collation for
              new objects differ from previously unless an explicit
              character set and collation are specified. This includes
              databases and objects within them, such as tables, views,
              and stored programs. Assuming that the previous defaults
              were used, one way to preserve them is to start the server
              with these lines in the <code class="filename">my.cnf</code> file:
            </p><pre data-lang="ini" class="programlisting">
[mysqld]
character_set_server=latin1
collation_server=latin1_swedish_ci
</pre><p>
              In a replicated setting, when upgrading from MySQL 5.7 to
              8.0, it is advisable to change the default character set
              back to the character set used in MySQL 5.7 before
              upgrading. After the upgrade is completed, the default
              character set can be changed to
              <code class="literal">utf8mb4</code>.
            </p></li><li class="listitem"><p>
              <span class="bold"><strong>Incompatible change</strong></span>: As
              of MySQL 8.0.11, it is prohibited to start the server with
              a <a class="link" href="server-administration.html#sysvar_lower_case_table_names"><code class="literal">lower_case_table_names</code></a>
              setting that is different from the setting used when the
              server was initialized. The restriction is necessary
              because collations used by various data dictionary table
              fields are based on the setting defined when the server is
              initialized, and restarting the server with a different
              setting would introduce inconsistencies with respect to
              how identifiers are ordered and compared.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-server-changes"></a>Server Changes</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              In MySQL 8.0.11, several deprecated features related to
              account management have been removed, such as use of the
              <code class="literal">GRANT</code> statement to modify
              nonprivilege characteristics of user accounts, the
              <code class="literal">NO_AUTO_CREATE_USER</code> SQL mode, the
              <code class="literal">PASSWORD()</code> function, and the
              <code class="option">old_passwords</code> system variable.
            </p><p>
              Replication from MySQL 5.7 to 8.0 of statements that refer
              to these removed features can cause replication failure.
              Applications that use any of the removed features should
              be revised to avoid them and use alternatives when
              possible, as described in
              <a class="xref" href="introduction.html#mysql-nutshell-removals" title="Features Removed in MySQL 8.0">Features Removed in MySQL 8.0</a>.
            </p></li><li class="listitem"><p>
              In MySQL 8.0.11, these deprecated compatibility SQL modes
              were removed: <code class="literal">DB2</code>,
              <code class="literal">MAXDB</code>, <code class="literal">MSSQL</code>,
              <code class="literal">MYSQL323</code>, <code class="literal">MYSQL40</code>,
              <code class="literal">ORACLE</code>, <code class="literal">POSTGRESQL</code>,
              <code class="literal">NO_FIELD_OPTIONS</code>,
              <code class="literal">NO_KEY_OPTIONS</code>,
              <code class="literal">NO_TABLE_OPTIONS</code>. They can no longer be
              assigned to the <code class="literal">sql_mode</code> system
              variable or used as permitted values for the
              <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>
              <a class="link" href="programs.html#option_mysqldump_compatible"><code class="option">--compatible</code></a> option.
            </p><p>
              Removal of <code class="literal">MAXDB</code> means that the
              <code class="literal">TIMESTAMP</code> data type for
              <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
              <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> is no longer
              treated as <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">DATETIME</code></a>.
            </p><p>
              Replication from MySQL 5.7 to 8.0 of statements that refer
              to the removed SQL modes can cause replication failure.
              This includes replication of <code class="literal">CREATE</code>
              statements for stored programs (stored procedures and
              functions, triggers, and events) that are executed while
              the current <a class="link" href="server-administration.html#sysvar_sql_mode"><code class="literal">sql_mode</code></a>
              value includes any of the removed modes. Applications that
              use any of the removed modes should be revised to avoid
              them.
            </p></li><li class="listitem"><p>
              As of MySQL 8.0.3, spatial data types permit an
              <code class="literal">SRID</code> attribute, to explicitly indicate
              the spatial reference system (SRS) for values stored in
              the column. See <a class="xref" href="data-types.html#spatial-type-overview" title="11.5.1 Spatial Data Types">Section 11.5.1, “Spatial Data Types”</a>.
            </p><p>
              A spatial column with an explicit <code class="literal">SRID</code>
              attribute is SRID-restricted: The column takes only values
              with that ID, and <code class="literal">SPATIAL</code> indexes on
              the column become subject to use by the optimizer. The
              optimizer ignores <code class="literal">SPATIAL</code> indexes on
              spatial columns with no <code class="literal">SRID</code> attribute.
              See <a class="xref" href="optimization.html#spatial-index-optimization" title="8.3.3 SPATIAL Index Optimization">Section 8.3.3, “SPATIAL Index Optimization”</a>. If you
              wish the optimizer to consider <code class="literal">SPATIAL</code>
              indexes on spatial columns that are not SRID-restricted,
              each such column should be modified:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  Verify that all values within the column have the same
                  SRID. To determine the SRIDs contained in a geometry
                  column <em class="replaceable"><code>col_name</code></em>, use the
                  following query:
                </p><pre data-lang="sql" class="programlisting">
SELECT DISTINCT ST_SRID(<em class="replaceable"><code>col_name</code></em>) FROM <em class="replaceable"><code>tbl_name</code></em>;
</pre><p>
                  If the query returns more than one row, the column
                  contains a mix of SRIDs. In that case, modify its
                  contents so all values have the same SRID.
                </p></li><li class="listitem"><p>
                  Redefine the column to have an explicit
                  <code class="literal">SRID</code> attribute.
                </p></li><li class="listitem"><p>
                  Recreate the <code class="literal">SPATIAL</code> index.
</p></li></ul>
</div>
</li><li class="listitem"><p>
              Several spatial functions were removed in MySQL 8.0.0 due
              to a spatial function namespace change that implemented an
              <code class="literal">ST_</code> prefix for functions that perform
              an exact operation, or an <code class="literal">MBR</code> prefix
              for functions that perform an operation based on minimum
              bounding rectangles. The use of removed spatial functions
              in generated column definitions could cause an upgrade
              failure. Before upgrading, run <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck
              --check-upgrade</strong></span></a> for removed spatial functions
              and replace any that you find with their
              <code class="literal">ST_</code> or <code class="literal">MBR</code> named
              replacements. For a list of removed spatial functions,
              refer to <a class="xref" href="introduction.html#mysql-nutshell-removals" title="Features Removed in MySQL 8.0">Features Removed in MySQL 8.0</a>.
            </p></li><li class="listitem"><p>
              The <a class="link" href="security.html#priv_backup-admin"><code class="literal">BACKUP_ADMIN</code></a> privilege
              is automatically granted to users with the
              <a class="link" href="security.html#priv_reload"><code class="literal">RELOAD</code></a> privilege when
              performing an in-place upgrade to MySQL 8.0.3 or later.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-innodb-changes"></a>InnoDB Changes</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <a class="link" href="information-schema.html" title="Chapter 24 INFORMATION_SCHEMA Tables"><code class="literal">INFORMATION_SCHEMA</code></a> views
              based on <code class="literal">InnoDB</code> system tables were
              replaced by internal system views on data dictionary
              tables. Affected <code class="literal">InnoDB</code>
              <a class="link" href="information-schema.html" title="Chapter 24 INFORMATION_SCHEMA Tables"><code class="literal">INFORMATION_SCHEMA</code></a> views were
              renamed:
</p>
<div class="table">
<a name="innodb-new-is-views-upgrade"></a><p class="title"><b>Table 2.15 Renamed InnoDB Information Schema Views</b></p>
<div class="table-contents">
<table summary="InnoDB Information Schema views that were renamed in MySQL 8.0."><col width="50%"><col width="50%"><thead><tr>
                  <th scope="col">Old Name</th>
                  <th scope="col">New Name</th>
                </tr></thead><tbody><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_COLUMNS</code></td>
                  <td><code class="literal">INNODB_COLUMNS</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_DATAFILES</code></td>
                  <td><code class="literal">INNODB_DATAFILES</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_FIELDS</code></td>
                  <td><code class="literal">INNODB_FIELDS</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_FOREIGN</code></td>
                  <td><code class="literal">INNODB_FOREIGN</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_FOREIGN_COLS</code></td>
                  <td><code class="literal">INNODB_FOREIGN_COLS</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_INDEXES</code></td>
                  <td><code class="literal">INNODB_INDEXES</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_TABLES</code></td>
                  <td><code class="literal">INNODB_TABLES</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_TABLESPACES</code></td>
                  <td><code class="literal">INNODB_TABLESPACES</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_TABLESTATS</code></td>
                  <td><code class="literal">INNODB_TABLESTATS</code></td>
                </tr><tr>
                  <td scope="row"><code class="literal">INNODB_SYS_VIRTUAL</code></td>
                  <td><code class="literal">INNODB_VIRTUAL</code></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
              After upgrading to MySQL 8.0.3 or later, update any
              scripts that reference previous <code class="literal">InnoDB</code>
              <a class="link" href="information-schema.html" title="Chapter 24 INFORMATION_SCHEMA Tables"><code class="literal">INFORMATION_SCHEMA</code></a> view
              names.
            </p></li><li class="listitem"><p>
              The <a class="ulink" href="http://www.zlib.net/" target="_top">zlib library</a>
              version bundled with MySQL was raised from version 1.2.3
              to version 1.2.11.
            </p><p>
              The zlib <code class="literal">compressBound()</code> function in
              zlib 1.2.11 returns a slightly higher estimate of the
              buffer size required to compress a given length of bytes
              than it did in zlib version 1.2.3. The
              <code class="literal">compressBound()</code> function is called by
              <code class="literal">InnoDB</code> functions that determine the
              maximum row size permitted when creating compressed
              <code class="literal">InnoDB</code> tables or inserting rows into
              compressed <code class="literal">InnoDB</code> tables. As a result,
              <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE
              ... ROW_FORMAT=COMPRESSED</code></a> or
              <a class="link" href="sql-syntax.html#insert" title="13.2.6 INSERT Syntax"><code class="literal">INSERT</code></a> operations with row
              sizes very close to the maximum row size that were
              successful in earlier releases could now fail.
            </p><p>
              If you have compressed <code class="literal">InnoDB</code> tables
              with large rows, it is recommended that you test
              compressed table <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE
              TABLE</code></a> statements on a MySQL 8.0 test instance
              prior to upgrading.
            </p></li><li class="listitem"><p>
              With the introduction of the
              <a class="link" href="innodb-storage-engine.html#sysvar_innodb_directories"><code class="literal">--innodb-directories</code></a>
              feature, the location of file-per-table and general
              tablespace files created with an absolute path or in a
              location outside of the data directory should be added to
              the <a class="link" href="innodb-storage-engine.html#sysvar_innodb_directories"><code class="literal">innodb_directories</code></a>
              argument value. Otherwise, <code class="literal">InnoDB</code> is
              not able to locate these files during recovery. To view
              tablespace file locations, query the
              <a class="link" href="information-schema.html#files-table" title="24.9 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a>
              table:
            </p><pre data-lang="sql" class="programlisting">
SELECT TABLESPACE_NAME, FILE_NAME FROM INFORMATION_SCHEMA.FILES \G
</pre></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="upgrade-sql-changes"></a>SQL Changes</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Some keywords may be reserved in MySQL 8.0
              that were not reserved in MySQL 5.7. See
              <a class="xref" href="language-structure.html#keywords" title="9.3 Keywords and Reserved Words">Section 9.3, “Keywords and Reserved Words”</a>. This can cause words
              previously used as identifiers to become illegal. To fix
              affected statements, use identifier quoting. See
              <a class="xref" href="language-structure.html#identifiers" title="9.2 Schema Object Names">Section 9.2, “Schema Object Names”</a>.
            </p></li><li class="listitem"><p>
              After upgrading, it is recommended that you test optimizer
              hints specified in application code to ensure that the
              hints are still required to achieve the desired
              optimization strategy. Optimizer enhancements can
              sometimes render certain optimizer hints unnecessary. In
              some cases, an unnecessary optimizer hint may even be
              counterproductive.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="updating-yum-repo"></a>2.11.1.3 Upgrading MySQL with the MySQL Yum Repository</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653572576"></a><a class="indexterm" name="idm139899653571536"></a><p>
        For supported Yum-based platforms (see
        <a class="xref" href="installing.html#linux-installation-yum-repo" title="2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository">Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”</a>, for a list), you
        can perform an in-place upgrade for MySQL (that is, replacing
        the old version and then running the new version off the old
        data files) with the MySQL Yum repository.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Notes
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Before performing any update to MySQL, follow carefully
              the instructions in <a class="xref" href="installing.html#upgrading" title="2.11.1 Upgrading MySQL">Section 2.11.1, “Upgrading MySQL”</a>. Among
              other instructions discussed there, it is especially
              important to back up your database before the update.
            </p></li><li class="listitem"><p>
              The following instructions assume you have installed MySQL
              with the MySQL Yum repository or with an RPM package
              directly downloaded from
              <a class="ulink" href="http://dev.mysql.com/downloads/" target="_top">MySQL Developer Zone's
              MySQL Download page</a>; if that is not the case,
              following the instructions in
              <a class="ulink" href="http://dev.mysql.com/doc/refman/5.7/en/replace-third-party-yum.html" target="_top">Replacing a Third-Party Distribution of MySQL Using the MySQL Yum Repository</a>.
</p></li></ul>
</div>

</div>
<p>
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem">
<h5><a name="idm139899653561264"></a>Selecting a Target Series</h5>
<p>
              By default, the MySQL Yum repository updates MySQL to the
              latest version in the release series you have chosen
              during installation (see
              <a class="xref" href="installing.html#yum-repo-select-series" title="Selecting a Release Series">Selecting a Release Series</a> for details),
              which means, for example, a 5.7.x
              installation will NOT be updated to a 8.0.x
              release automatically. To update to another release
              series, you need to first disable the subrepository for
              the series that has been selected (by default, or by
              yourself) and enable the subrepository for your target
              series. To do that, see the general instructions given in
              <a class="xref" href="installing.html#yum-repo-select-series" title="Selecting a Release Series">Selecting a Release Series</a>. For upgrading
              from MySQL 5.7 to 8.0, perform
              the <span class="emphasis"><em>reverse</em></span> of the steps illustrated
              in <a class="xref" href="installing.html#yum-repo-select-series" title="Selecting a Release Series">Selecting a Release Series</a>, disabling the
              subrepository for the MySQL 5.7 series and
              enabling that for the MySQL 8.0 series.
            </p><p>
              As a general rule, to upgrade from one release series to
              another, go to the next series rather than skipping a
              series. For example, if you are currently running MySQL
              5.6 and wish to upgrade to 8.0, upgrade to
              MySQL 5.7 first before upgrading to
              8.0.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
                For important information about upgrading from MySQL
                5.7 to 8.0, see
                <a class="link" href="installing.html#upgrading-from-previous-series" title="2.11.1.2 Changes Affecting Upgrades to MySQL 8.0">Upgrading
                from MySQL 5.7 to 8.0</a>.
</p>
</div>
</li><li class="listitem">
<h5><a name="idm139899653553760"></a>Upgrading MySQL</h5>
<p>
              Upgrade MySQL and its components by the following command,
              for platforms that are not dnf-enabled:

</p><pre data-lang="terminal" class="programlisting">
sudo yum update mysql-server
</pre><p>

              For platforms that are dnf-enabled:

</p><pre data-lang="terminal" class="programlisting">
sudo dnf upgrade mysql-server
</pre><p>
            </p><p>
              Alternatively, you can update MySQL by telling Yum to
              update everything on your system, which might take
              considerably more time; for platforms that are not
              dnf-enabled:

</p><pre data-lang="terminal" class="programlisting">
sudo yum update
</pre><p>

              For platforms that are dnf-enabled:

</p><pre data-lang="terminal" class="programlisting">
sudo dnf upgrade
</pre><p>
</p></li><li class="listitem">
<h5><a name="idm139899653547584"></a>Restarting MySQL</h5>
<p>
              The MySQL server always restarts after an update by Yum.
              Once the server restarts, run
              <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> to check and possibly
              resolve any incompatibilities between the old data and the
              upgraded software. <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> also
              performs other functions; see
              <a class="xref" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables">Section 4.4.5, “<span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables”</a> for details.
</p></li></ol>
</div>
<p>
      </p><p>
        You can also update only a specific component. Use the following
        command to list all the installed packages for the MySQL
        components (for dnf-enabled systems, replace
        <span class="command"><strong>yum</strong></span> in the command with
        <span class="command"><strong>dnf</strong></span>):

</p><pre data-lang="terminal" class="programlisting">
sudo yum list installed | grep "^mysql"
</pre><p>

        After identifying the package name of the component of your
        choice, for platforms that are not dnf-enabled, update the
        package with the following command, replacing
        <em class="replaceable"><code>package-name</code></em> with the name of the
        package:

</p><pre data-lang="terminal" class="programlisting">
sudo yum update <em class="replaceable"><code>package-name</code></em>
</pre><p>

        For dnf-enabled platforms:

</p><pre data-lang="terminal" class="programlisting">
sudo dnf upgrade <em class="replaceable"><code>package-name</code></em>
</pre><p>
</p>
<h5><a name="updating-yum-repo-client-lib"></a>Upgrading the Shared Client Libraries</h5>
<p>
        After updating MySQL using the Yum repository, applications
        compiled with older versions of the shared client libraries
        should continue to work.
      </p><p>
        <span class="emphasis"><em>If you recompile applications and dynamically link
        them with the updated libraries: </em></span> As typical with new
        versions of shared libraries where there are differences or
        additions in symbol versioning between the newer and older
        libraries (for example, between the newer, standard
        8.0 shared client libraries and some
        older—prior or variant—versions of the shared
        libraries shipped natively by the Linux distributions' software
        repositories, or from some other sources), any applications
        compiled using the updated, newer shared libraries will require
        those updated libraries on systems where the applications are
        deployed. And, as expected, if those libraries are not in place,
        the applications requiring the shared libraries will fail. So,
        be sure to deploy the packages for the shared libraries from
        MySQL on those systems. You can do this by adding the MySQL Yum
        repository to the systems (see <a class="xref" href="installing.html#yum-repo-setup" title="Adding the MySQL Yum Repository">Adding the MySQL Yum Repository</a>)
        and install the latest shared libraries using the instructions
        given in <a class="xref" href="installing.html#yum-install-components" title="Installing Additional MySQL Products and Components with Yum">Installing Additional MySQL Products and Components with Yum</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="updating-apt-repo"></a>2.11.1.4 Upgrading MySQL with the MySQL APT Repository</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653529664"></a><a class="indexterm" name="idm139899653528624"></a><p>
        On Debian and Ubuntu platforms, you can perform an in-place
        upgrade of MySQL and its components with the MySQL APT
        repository. See
        <a class="ulink" href="http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/index.html#repo-qg-apt-upgrading" target="_top">Upgrading
        MySQL with the MySQL APT Repository</a> in
        <a class="ulink" href="http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/" target="_top">A
        Quick Guide to Using the MySQL APT Repository</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="downgrading"></a>2.11.2 Downgrading MySQL</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653523552"></a><p>
      Downgrade from MySQL 8.0 to MySQL 5.7
      (or from a MySQL 8.0 release to a previous MySQL
      8.0 release) is not supported. The only supported
      alternative is to restore a backup taken
      <span class="emphasis"><em>before</em></span> upgrading. It is therefore imperative
      that you backup your data before starting the upgrade process.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="rebuilding-tables"></a>2.11.3 Rebuilding or Repairing Tables or Indexes</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653520032"></a><a class="indexterm" name="idm139899653518576"></a><a class="indexterm" name="idm139899653517088"></a><p>
      This section describes how to rebuild or repair tables or indexes,
      which may be necessitated by:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Changes to how MySQL handles data types or character sets. For
          example, an error in a collation might have been corrected,
          necessitating a table rebuild to update the indexes for
          character columns that use the collation.
        </p></li><li class="listitem"><p>
          Required table repairs or upgrades reported by
          <a class="link" href="sql-syntax.html#check-table" title="13.7.3.2 CHECK TABLE Syntax"><code class="literal">CHECK TABLE</code></a>,
          <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a>, or
          <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>.
</p></li></ul>
</div>
<p>
      Methods for rebuilding a table include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="installing.html#rebuilding-tables-dump-reload" title="Dump and Reload Method">Dump and Reload Method</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#rebuilding-tables-alter-table" title="ALTER TABLE Method">ALTER TABLE Method</a></p></li><li class="listitem"><p><a class="xref" href="installing.html#rebuilding-tables-repair-table" title="REPAIR TABLE Method">REPAIR TABLE Method</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="rebuilding-tables-dump-reload"></a>Dump and Reload Method</h4>

</div>

</div>

</div>
<p>
        If you are rebuilding tables because a different version of
        MySQL will not handle them after a binary (in-place) upgrade or
        downgrade, you must use the dump-and-reload method. Dump the
        tables <span class="emphasis"><em>before</em></span> upgrading or downgrading
        using your original version of MySQL. Then reload the tables
        <span class="emphasis"><em>after</em></span> upgrading or downgrading.
      </p><p>
        If you use the dump-and-reload method of rebuilding tables only
        for the purpose of rebuilding indexes, you can perform the dump
        either before or after upgrading or downgrading. Reloading still
        must be done afterward.
      </p><p>
        If you need to rebuild an <code class="literal">InnoDB</code> table
        because a <a class="link" href="sql-syntax.html#check-table" title="13.7.3.2 CHECK TABLE Syntax"><code class="literal">CHECK TABLE</code></a> operation
        indicates that a table upgrade is required, use
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to create a dump file and
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> to reload the file. If the
        <a class="link" href="sql-syntax.html#check-table" title="13.7.3.2 CHECK TABLE Syntax"><code class="literal">CHECK TABLE</code></a> operation indicates
        that there is a corruption or causes <code class="literal">InnoDB</code>
        to fail, refer to <a class="xref" href="innodb-storage-engine.html#forcing-innodb-recovery" title="15.20.2 Forcing InnoDB Recovery">Section 15.20.2, “Forcing InnoDB Recovery”</a> for
        information about using the
        <a class="link" href="innodb-storage-engine.html#sysvar_innodb_force_recovery"><code class="literal">innodb_force_recovery</code></a> option to
        restart <code class="literal">InnoDB</code>. To understand the type of
        problem that <a class="link" href="sql-syntax.html#check-table" title="13.7.3.2 CHECK TABLE Syntax"><code class="literal">CHECK TABLE</code></a> may be
        encountering, refer to the <code class="literal">InnoDB</code> notes in
        <a class="xref" href="sql-syntax.html#check-table" title="13.7.3.2 CHECK TABLE Syntax">Section 13.7.3.2, “CHECK TABLE Syntax”</a>.
      </p><p>
        To rebuild a table by dumping and reloading it, use
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to create a dump file and
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> to reload the file:
      </p><pre data-lang="terminal" class="programlisting">
mysqldump <em class="replaceable"><code>db_name</code></em> t1 &gt; dump.sql
mysql <em class="replaceable"><code>db_name</code></em> &lt; dump.sql
</pre><p>
        To rebuild all the tables in a single database, specify the
        database name without any following table name:
      </p><pre data-lang="terminal" class="programlisting">
mysqldump <em class="replaceable"><code>db_name</code></em> &gt; dump.sql
mysql <em class="replaceable"><code>db_name</code></em> &lt; dump.sql
</pre><p>
        To rebuild all tables in all databases, use the
        <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option:
      </p><pre data-lang="terminal" class="programlisting">
mysqldump --all-databases &gt; dump.sql
mysql &lt; dump.sql
</pre>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="rebuilding-tables-alter-table"></a>ALTER TABLE Method</h4>

</div>

</div>

</div>
<p>
        To rebuild a table with <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER
        TABLE</code></a>, use a <span class="quote">“<span class="quote">null</span>”</span> alteration; that is,
        an <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> statement that
        <span class="quote">“<span class="quote">changes</span>”</span> the table to use the storage engine that
        it already has. For example, if <code class="literal">t1</code> is an
        <code class="literal">InnoDB</code> table, use this statement:
      </p><pre data-lang="sql" class="programlisting">
ALTER TABLE t1 ENGINE = InnoDB;
</pre><p>
        If you are not sure which storage engine to specify in the
        <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> statement, use
        <a class="link" href="sql-syntax.html#show-create-table" title="13.7.6.10 SHOW CREATE TABLE Syntax"><code class="literal">SHOW CREATE TABLE</code></a> to display the
        table definition.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="rebuilding-tables-repair-table"></a>REPAIR TABLE Method</h4>

</div>

</div>

</div>
<p>
        The <a class="link" href="sql-syntax.html#repair-table" title="13.7.3.5 REPAIR TABLE Syntax"><code class="literal">REPAIR TABLE</code></a> method is only
        applicable to <code class="literal">MyISAM</code>,
        <code class="literal">ARCHIVE</code>, and <code class="literal">CSV</code> tables.
      </p><p>
        You can use <a class="link" href="sql-syntax.html#repair-table" title="13.7.3.5 REPAIR TABLE Syntax"><code class="literal">REPAIR TABLE</code></a> if the
        table checking operation indicates that there is a corruption or
        that an upgrade is required. For example, to repair a
        <code class="literal">MyISAM</code> table, use this statement:
      </p><pre data-lang="sql" class="programlisting">
REPAIR TABLE t1;
</pre><p>
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck --repair</strong></span></a> provides command-line
        access to the <a class="link" href="sql-syntax.html#repair-table" title="13.7.3.5 REPAIR TABLE Syntax"><code class="literal">REPAIR TABLE</code></a>
        statement. This can be a more convenient means of repairing
        tables because you can use the
        <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a> or
        <a class="link" href="programs.html#option_mysqlcheck_all-databases"><code class="option">--all-databases</code></a> option to
        repair all tables in specific databases or all databases,
        respectively:
      </p><pre data-lang="terminal" class="programlisting">
mysqlcheck --repair --databases <em class="replaceable"><code>db_name</code></em> ...
mysqlcheck --repair --all-databases
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="copying-databases"></a>2.11.4 Copying MySQL Databases to Another Machine</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653452144"></a><a class="indexterm" name="idm139899653450688"></a><a class="indexterm" name="idm139899653449616"></a><p>
      In cases where you need to transfer databases between different
      architectures, you can use <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to create
      a file containing SQL statements. You can then transfer the file
      to the other machine and feed it as input to the
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client.
    </p><p>
      Use <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump --help</strong></span></a> to see what options are
      available.
    </p><p>
      The easiest (although not the fastest) way to move a database
      between two machines is to run the following commands on the
      machine on which the database is located:
    </p><pre data-lang="terminal" class="programlisting">
mysqladmin -h '<em class="replaceable"><code>other_hostname</code></em>' create <em class="replaceable"><code>db_name</code></em>
mysqldump <em class="replaceable"><code>db_name</code></em> | mysql -h '<em class="replaceable"><code>other_hostname</code></em>' <em class="replaceable"><code>db_name</code></em>
</pre><p>
      If you want to copy a database from a remote machine over a slow
      network, you can use these commands:
    </p><pre data-lang="terminal" class="programlisting">
mysqladmin create <em class="replaceable"><code>db_name</code></em>
mysqldump -h '<em class="replaceable"><code>other_hostname</code></em>' --compress <em class="replaceable"><code>db_name</code></em> | mysql <em class="replaceable"><code>db_name</code></em>
</pre><p>
      You can also store the dump in a file, transfer the file to the
      target machine, and then load the file into the database there.
      For example, you can dump a database to a compressed file on the
      source machine like this:
    </p><pre data-lang="terminal" class="programlisting">
mysqldump --quick <em class="replaceable"><code>db_name</code></em> | gzip &gt; <em class="replaceable"><code>db_name</code></em>.gz
</pre><p>
      Transfer the file containing the database contents to the target
      machine and run these commands there:
    </p><pre data-lang="terminal" class="programlisting">
mysqladmin create <em class="replaceable"><code>db_name</code></em>
gunzip &lt; <em class="replaceable"><code>db_name</code></em>.gz | mysql <em class="replaceable"><code>db_name</code></em>
</pre><a class="indexterm" name="idm139899653430208"></a><a class="indexterm" name="idm139899653429136"></a><p>
      You can also use <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> and
      <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> to transfer the database. For large
      tables, this is much faster than simply using
      <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>. In the following commands,
      <em class="replaceable"><code>DUMPDIR</code></em> represents the full path name
      of the directory you use to store the output from
      <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>.
    </p><p>
      First, create the directory for the output files and dump the
      database:
    </p><pre data-lang="terminal" class="programlisting">
mkdir <em class="replaceable"><code>DUMPDIR</code></em>
mysqldump --tab=<em class="replaceable"><code>DUMPDIR</code></em> <em class="replaceable"><code>db_name</code></em>
</pre><p>
      Then transfer the files in the <em class="replaceable"><code>DUMPDIR</code></em>
      directory to some corresponding directory on the target machine
      and load the files into MySQL there:
    </p><pre data-lang="terminal" class="programlisting">
mysqladmin create <em class="replaceable"><code>db_name</code></em>           # create database
cat <em class="replaceable"><code>DUMPDIR</code></em>/*.sql | mysql <em class="replaceable"><code>db_name</code></em>   # create tables in database
mysqlimport <em class="replaceable"><code>db_name</code></em> <em class="replaceable"><code>DUMPDIR</code></em>/*.txt   # load data into tables
</pre><p>
      Do not forget to copy the <code class="literal">mysql</code> database
      because that is where the grant tables are stored. You might have
      to run commands as the MySQL <code class="literal">root</code> user on the
      new machine until you have the <code class="literal">mysql</code> database
      in place.
    </p><p>
      After you import the <code class="literal">mysql</code> database on the new
      machine, execute <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin flush-privileges</strong></span></a> so
      that the server reloads the grant table information.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="perl-support"></a>2.12 Perl Installation Notes</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="installing.html#perl-installation">2.12.1 Installing Perl on Unix</a></span></dt><dt><span class="section"><a href="installing.html#activestate-perl">2.12.2 Installing ActiveState Perl on Windows</a></span></dt><dt><span class="section"><a href="installing.html#perl-support-problems">2.12.3 Problems Using the Perl DBI/DBD Interface</a></span></dt></dl>
</div>
<a class="indexterm" name="idm139899653408384"></a><a class="indexterm" name="idm139899653406896"></a><p>
    The Perl <code class="literal">DBI</code> module provides a generic interface
    for database access. You can write a <code class="literal">DBI</code> script
    that works with many different database engines without change. To
    use <code class="literal">DBI</code>, you must install the
    <code class="literal">DBI</code> module, as well as a DataBase Driver (DBD)
    module for each type of database server you want to access. For
    MySQL, this driver is the <code class="literal">DBD::mysql</code> module.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
      Perl support is not included with MySQL distributions. You can
      obtain the necessary modules from
      <a class="ulink" href="http://search.cpan.org" target="_top">http://search.cpan.org</a> for Unix, or by using the
      ActiveState <span class="command"><strong>ppm</strong></span> program on Windows. The
      following sections describe how to do this.
</p>
</div>
<p>
    The <code class="literal">DBI</code>/<code class="literal">DBD</code> interface requires
    Perl 5.6.0, and 5.6.1 or later is preferred. DBI <span class="emphasis"><em>does not
    work</em></span> if you have an older version of Perl. You should use
    <code class="literal">DBD::mysql</code> 4.009 or higher. Although earlier
    versions are available, they do not support the full functionality
    of MySQL 8.0.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="perl-installation"></a>2.12.1 Installing Perl on Unix</h3>
</div>
</div>
</div>
<p>
      MySQL Perl support requires that you have installed MySQL client
      programming support (libraries and header files). Most
      installation methods install the necessary files. If you install
      MySQL from RPM files on Linux, be sure to install the developer
      RPM as well. The client programs are in the client RPM, but client
      programming support is in the developer RPM.
    </p><p>
      The files you need for Perl support can be obtained from the CPAN
      (Comprehensive Perl Archive Network) at
      <a class="ulink" href="http://search.cpan.org" target="_top">http://search.cpan.org</a>.
    </p><p>
      The easiest way to install Perl modules on Unix is to use the
      <code class="literal">CPAN</code> module. For example:
    </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>perl -MCPAN -e shell</code></strong>
cpan&gt; <strong class="userinput"><code>install DBI</code></strong>
cpan&gt; <strong class="userinput"><code>install DBD::mysql</code></strong>
</pre><p>
      The <code class="literal">DBD::mysql</code> installation runs a number of
      tests. These tests attempt to connect to the local MySQL server
      using the default user name and password. (The default user name
      is your login name on Unix, and <code class="literal">ODBC</code> on
      Windows. The default password is <span class="quote">“<span class="quote">no password.</span>”</span>) If
      you cannot connect to the server with those values (for example,
      if your account has a password), the tests fail. You can use
      <code class="literal">force install DBD::mysql</code> to ignore the failed
      tests.
    </p><p>
      <code class="literal">DBI</code> requires the
      <code class="literal">Data::Dumper</code> module. It may be installed; if
      not, you should install it before installing
      <code class="literal">DBI</code>.
    </p><p>
      It is also possible to download the module distributions in the
      form of compressed <span class="command"><strong>tar</strong></span> archives and build the
      modules manually. For example, to unpack and build a DBI
      distribution, use a procedure such as this:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Unpack the distribution into the current directory:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>gunzip &lt; DBI-<em class="replaceable"><code>VERSION</code></em>.tar.gz | tar xvf -</code></strong>
</pre><p>
          This command creates a directory named
          <code class="filename">DBI-<em class="replaceable"><code>VERSION</code></em></code>.
        </p></li><li class="listitem"><p>
          Change location into the top-level directory of the unpacked
          distribution:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>cd DBI-<em class="replaceable"><code>VERSION</code></em></code></strong>
</pre></li><li class="listitem"><p>
          Build the distribution and compile everything:
        </p><pre data-lang="terminal" class="programlisting">
shell&gt; <strong class="userinput"><code>perl Makefile.PL</code></strong>
shell&gt; <strong class="userinput"><code>make</code></strong>
shell&gt; <strong class="userinput"><code>make test</code></strong>
shell&gt; <strong class="userinput"><code>make install</code></strong>
</pre></li></ol>
</div>
<p>
      The <span class="command"><strong>make test</strong></span> command is important because it
      verifies that the module is working. Note that when you run that
      command during the <code class="literal">DBD::mysql</code> installation to
      exercise the interface code, the MySQL server must be running or
      the test fails.
    </p><p>
      It is a good idea to rebuild and reinstall the
      <code class="literal">DBD::mysql</code> distribution whenever you install a
      new release of MySQL. This ensures that the latest versions of the
      MySQL client libraries are installed correctly.
    </p><p>
      If you do not have access rights to install Perl modules in the
      system directory or if you want to install local Perl modules, the
      following reference may be useful:
      <a class="ulink" href="http://learn.perl.org/faq/perlfaq8.html#How-do-I-keep-my-own-module-library-directory-" target="_top">http://learn.perl.org/faq/perlfaq8.html#How-do-I-keep-my-own-module-library-directory-</a>
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="activestate-perl"></a>2.12.2 Installing ActiveState Perl on Windows</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653362528"></a><a class="indexterm" name="idm139899653361072"></a><a class="indexterm" name="idm139899653359584"></a><p>
      On Windows, you should do the following to install the MySQL
      <code class="literal">DBD</code> module with ActiveState Perl:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
          Get ActiveState Perl from
          <a class="ulink" href="http://www.activestate.com/Products/ActivePerl/" target="_top">http://www.activestate.com/Products/ActivePerl/</a>
          and install it.
        </p></li><li class="listitem"><p>
          Open a console window.
        </p></li><li class="listitem"><p>
          If necessary, set the <code class="literal">HTTP_proxy</code> variable.
          For example, you might try a setting like this:
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>set HTTP_proxy=my.proxy.com:3128</code></strong>
</pre></li><li class="listitem"><p>
          Start the PPM program:
        </p><pre data-lang="terminal" class="programlisting">
C:\&gt; <strong class="userinput"><code>C:\perl\bin\ppm.pl</code></strong>
</pre></li><li class="listitem"><p>
          If you have not previously done so, install
          <code class="literal">DBI</code>:
        </p><pre data-lang="terminal" class="programlisting">
ppm&gt; <strong class="userinput"><code>install DBI</code></strong>
</pre></li><li class="listitem"><p>
          If this succeeds, run the following command:
        </p><pre data-lang="terminal" class="programlisting">
ppm&gt; <strong class="userinput"><code>install DBD-mysql</code></strong>
</pre></li></ol>
</div>
<p>
      This procedure should work with ActiveState Perl 5.6 or higher.
    </p><p>
      If you cannot get the procedure to work, you should install the
      ODBC driver instead and connect to the MySQL server through ODBC:
    </p><pre data-lang="perl" class="programlisting">
use DBI;
$dbh= DBI-&gt;connect("DBI:ODBC:$dsn",$user,$password) ||
  die "Got error $DBI::errstr when connecting to $dsn\n";
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="perl-support-problems"></a>2.12.3 Problems Using the Perl DBI/DBD Interface</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139899653339168"></a><a class="indexterm" name="idm139899653337712"></a><p>
      If Perl reports that it cannot find the
      <code class="filename">../mysql/mysql.so</code> module, the problem is
      probably that Perl cannot locate the
      <code class="filename">libmysqlclient.so</code> shared library. You should
      be able to fix this problem by one of the following methods:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Copy <code class="filename">libmysqlclient.so</code> to the directory
          where your other shared libraries are located (probably
          <code class="filename">/usr/lib</code> or <code class="filename">/lib</code>).
        </p></li><li class="listitem"><p>
          Modify the <code class="option">-L</code> options used to compile
          <code class="literal">DBD::mysql</code> to reflect the actual location
          of <code class="filename">libmysqlclient.so</code>.
        </p></li><li class="listitem"><p>
          On Linux, you can add the path name of the directory where
          <code class="filename">libmysqlclient.so</code> is located to the
          <code class="filename">/etc/ld.so.conf</code> file.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm139899653325312"></a>

          <a class="indexterm" name="idm139899653324224"></a>

          <a class="indexterm" name="idm139899653322736"></a>

          <a class="indexterm" name="idm139899653321648"></a>

          Add the path name of the directory where
          <code class="filename">libmysqlclient.so</code> is located to the
          <code class="literal">LD_RUN_PATH</code> environment variable. Some
          systems use <code class="literal">LD_LIBRARY_PATH</code> instead.
</p></li></ul>
</div>
<p>
      Note that you may also need to modify the <code class="option">-L</code>
      options if there are other libraries that the linker fails to
      find. For example, if the linker cannot find
      <code class="literal">libc</code> because it is in <code class="filename">/lib</code>
      and the link command specifies <code class="option">-L/usr/lib</code>, change
      the <code class="option">-L</code> option to <code class="option">-L/lib</code> or add
      <code class="option">-L/lib</code> to the existing link command.
    </p><p>
      If you get the following errors from
      <code class="literal">DBD::mysql</code>, you are probably using
      <span class="command"><strong>gcc</strong></span> (or using an old binary compiled with
      <span class="command"><strong>gcc</strong></span>):
    </p><pre data-lang="none" class="programlisting">
/usr/bin/perl: can't resolve symbol '__moddi3'
/usr/bin/perl: can't resolve symbol '__divdi3'
</pre><p>
      Add <code class="option">-L/usr/lib/gcc-lib/... -lgcc</code> to the link
      command when the <code class="filename">mysql.so</code> library gets built
      (check the output from <span class="command"><strong>make</strong></span> for
      <code class="filename">mysql.so</code> when you compile the Perl client).
      The <code class="option">-L</code> option should specify the path name of the
      directory where <code class="filename">libgcc.a</code> is located on your
      system.
    </p><p>
      Another cause of this problem may be that Perl and MySQL are not
      both compiled with <span class="command"><strong>gcc</strong></span>. In this case, you can
      solve the mismatch by compiling both with <span class="command"><strong>gcc</strong></span>.
</p>
</div>

</div>

</div>
<div class="copyright-footer">

</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a></td>
<td width="20%" align="center"><a accesskey="u" href="">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="tutorial.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 1 General Information</td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top">Chapter 3 Tutorial</td>
</tr>
</table>
</div>
</body>
</html>
